Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset Buddy_objnum when buddy is deleted
Various code assumes that Buddy_objnum maintains the invariants: - If the guidebot exists, Buddy_objnum must refer to it. - If no guidebot exists, Buddy_objnum must be object_none. This was not enforced, so if the guidebot is killed, Buddy_objnum can continue to refer to its last index. That can cause spurious errors later. For example, when the player enters an energy center, if the guidebot is dead and the guidebot's last goal was "Find energy center", then the console reports: ``` BUG: buddy is object 28, but that object is type 255. ``` Fix that by clearing the guidebot index when the guidebot is killed.
- Loading branch information