mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-21 00:20:59 +00:00
- Duke/RR: do not spawn sprites with invalid picnums.
RRRA E1L7 has a respawner that will spawn an invalid sprite crashing the game.
This commit is contained in:
parent
07656251d9
commit
b1cbecf268
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,8 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
|
|||
{
|
||||
// sector pointer must be strictly validated here or the engine will crash.
|
||||
if (whatsectp == nullptr || !validSectorIndex(sectnum(whatsectp))) return nullptr;
|
||||
// spawning out of range sprites will also crash.
|
||||
if (s_pn < 0 || s_pn >= MAXTILES) return nullptr;
|
||||
auto act = static_cast<DDukeActor*>(::InsertActor(RUNTIME_CLASS(DDukeActor), whatsectp, s_ss));
|
||||
|
||||
if (act == nullptr) return nullptr;
|
||||
|
|
Loading…
Reference in a new issue