explosivegaming / scenario

Factorio scenario
https://explosivegaming.nl
GNU General Public License v3.0
23 stars 28 forks source link

Fix #279: Add spectate check to stop_follow #285

Closed Cooldude2606 closed 8 months ago

Cooldude2606 commented 9 months ago

Fixes the issue of spawning a new character when spectate is stopped while follow is active. This was caused by the following logic path: 1) stop_spectate would return you to your orginal body. 2) on_tick for follow would see you had a character and attempt to stop itself with stop_follow 3) Because start_spectate was successful in start_follow it assumes that stop_spectate needs to be called. 4) However, because it has already been called once it now has no reference to your character, this triggers a respawn. 5) Respawning disconnects your orginal body and gives you a new one.