mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-03 12:59:28 +00:00
* Stops admin spawned ghost portals from mutating global lists (#74607) ## About The Pull Request Admin spawned ghost portals call `make_ghost_swarm(null)` This in turn causes `!length(candidate_list)` to succeed The intended effect of this is that the candidate list gains the entries of `GLOB.current_observers_list` and `GLOB.dead_player_list` In actuality, what this does is that it causes `candidate_list` to be assigned to `GLOB.current_observers_list`, then adds the contents of `GLOB.dead_player_list` to `GLOB.current_observers_list` This is because `null += list()` just sets the variable to the list, while `list() += list()` adds the contents of the latter to the former in place (does not produce a new list object) All this needs is a default set so that a `null` value passed uses an empty list rather than nothing ## Why It's Good For The Game This is very unlikely to pop up (admin only in fact), but it's mutating managed globals like this is not good. ## Changelog 🆑 Melbert fix: Admin spawned ghost portals no longer make all dead players considered also as observers (they're two different things) /🆑 * Stops admin spawned ghost portals from mutating global lists --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>