I was reviewing some odd borg behavior that crept in during the change to Angband 320. One error seems to be the borg selling at item at the house, then immediately trying to sell the exact same item to a shop; as if he still had it in the inventory. Once he gets to the shop, he sells an item in the old items inventory slot. So the inventory is not being updated after he drops the item in the house.
Same thing happens with ring swapping. During one round he will remove both rings, scan the inventory and re-wear the rings in the proper order (wearing the ring which had been on the left hand first, then wearing the ring which had been on the right hand).
I have stepped through the code and found that the borg is correctly scanning the &p_ptr->inventory[], but the p_ptr->inventory is not being immediately updated after the borg's keypresses. So the borg is essentially scanning the old inventory and equipment state instead of the state following the keypresses. Vanilla 309 and previous versions immediately updated the p_ptr->inventory[] following any borg keypresses.
Does anyone know if the update is being delayed? Maybe waiting for an event handler change or something? And if so, how do I fix it?
Same thing happens with ring swapping. During one round he will remove both rings, scan the inventory and re-wear the rings in the proper order (wearing the ring which had been on the left hand first, then wearing the ring which had been on the right hand).
I have stepped through the code and found that the borg is correctly scanning the &p_ptr->inventory[], but the p_ptr->inventory is not being immediately updated after the borg's keypresses. So the borg is essentially scanning the old inventory and equipment state instead of the state following the keypresses. Vanilla 309 and previous versions immediately updated the p_ptr->inventory[] following any borg keypresses.
Does anyone know if the update is being delayed? Maybe waiting for an event handler change or something? And if so, how do I fix it?
Comment