Files
Bubberstation/code/modules/events
SkyratBot 0fe8982690 [MIRROR] Disease Outbreak/Heart Attack candidate lists clear themselves before generating [MDB IGNORE] (#19513)
* Disease Outbreak/Heart Attack candidate lists clear themselves before generating (#73596)

## About The Pull Request

When canSpawnEvent is run for the disease outbreak event, it would
generate_candidates() and add whoever was a valid infectee to a list.
Unfortunately, this list would not be cleared until the event was
actually run, meaning the candidate list could become malformed if the
event was cancelled, interrupted, or otherwise stopped before it could
properly start.

Additionally, this issue would arise if the admin setup process was
begun without actually running the event, or if two admins were
attempting to press buttons at the same time.

The list could contain duplicates, or players who were valid candidates
on the first candidacy check, but not at the present moment. The list
now clears itself every time it is generated, meaning that a fresh
candidate list is made every time one is needed.

Since the heart attack event uses the same candidate generating system
as the disease event, the change has been made there as well.

## Why It's Good For The Game

Closes #73552, hopefully? I can't imagine it's an issue with how the
candidates are selected, and am like 99% sure it's just the list getting
fudged somehow.

## Changelog
🆑
fix: The disease outbreak/heart attack event candidate list will now
clear itself before generating.
/🆑

* Disease Outbreak/Heart Attack candidate lists clear themselves before generating

---------

Co-authored-by: Rhials <Datguy33456@gmail.com>
2023-02-24 01:17:47 -08:00
..
2022-11-15 06:59:06 +00:00