mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- block StaticPointerSubstitution for non-player objects.
The only safe use of this function is to swap out PlayerPawns for morphing or respawning.
This commit is contained in:
parent
a50a5101bc
commit
b7970ed763
1 changed files with 3 additions and 0 deletions
|
@ -491,6 +491,9 @@ void DObject::StaticPointerSubstitution (AActor *old, AActor *notOld)
|
|||
|
||||
if (old == nullptr) return;
|
||||
|
||||
// This is only allowed to replace players. For everything else the results are undefined.
|
||||
if (!old->IsKindOf(NAME_PlayerPawn) || (notOld != nullptr && !notOld->IsKindOf(NAME_PlayerPawn))) return;
|
||||
|
||||
// Go through all objects.
|
||||
i = 0;DObject *last=0;
|
||||
for (probe = GC::Root; probe != NULL; probe = probe->ObjNext)
|
||||
|
|
Loading…
Reference in a new issue