Files
Bubberstation/code/game/objects/effects
SkyratBot 018198a406 [MIRROR] Stops admin spawned ghost portals from mutating global lists [MDB IGNORE] (#20444)
* 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>
2023-04-09 19:11:02 -07:00
..
2022-11-15 06:59:06 +00:00
2022-11-15 06:59:06 +00:00
2022-11-15 06:59:06 +00:00