[0.17.21] Destroyed construction bot stops on_robot_built_entity propagation to other mods
Posted: Wed Mar 27, 2019 12:18 am
When 2 mods are both subscribed to the on_robot_built_entity event and a mod destroys the construction bot that did the building later called mods never receive the event.
I would expect the later mods to still receive the event, however, the referenced "robot" in the event table would be to a non-valid entity.
I would expect the later mods to still receive the event, however, the referenced "robot" in the event table would be to a non-valid entity.
Test Setup
- Extract the 2 mod folders from the zip.
Mod A will destroy() the construction robot that is referenced as "robot" on the on_robot_built_entity event.
Mod B will print a message in-game on the on_robot_built_entity event. No event data is utilised in this to avoid any possible reference issues. - Put the save in place. It is just a player with power armor and construction robots setup.
Test Without destroying robot - prove Mod B works
- Disable Mod A
- Enable Mod B
- Load the save
- Place a ghost small power pole
- The construction robot builds it
- Mod B will write an in-game message to confirm that the on_robot_built_entity has triggered.
Test destroying robot - show bug
- Enable Mod A & Mod B
- Load the save
- Place a ghost small power pole
- The construction robot builds it
- Mod A reacts to the on_robot_built_entity event and destroys the construction robot.
- Mob B does not write a message as it never received the event on_robot_built_entity. This is the bug.