mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- validate statnum before spawning an actor.
This commit is contained in:
parent
da0b429751
commit
918c75cb6e
1 changed files with 1 additions and 0 deletions
|
@ -85,6 +85,7 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, PClassActor*
|
|||
info = spawnMap.CheckKey(s_pn);
|
||||
if (info) clstype = static_cast<PClassActor*>(info->cls);
|
||||
}
|
||||
if (s_stat < 0) s_stat = clstype ? GetDefaultByType(clstype)->spr.statnum : 0;
|
||||
|
||||
auto act = static_cast<DDukeActor*>(InsertActor(clstype? clstype : RUNTIME_CLASS(DDukeActor), whatsectp, s_stat));
|
||||
if (act == nullptr) return nullptr;
|
||||
|
|
Loading…
Reference in a new issue