mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Fix segfault when passing NULL as player
This commit is contained in:
parent
b3aa23bc21
commit
51e912e87b
1 changed files with 2 additions and 1 deletions
|
@ -10886,6 +10886,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type, ...)
|
|||
// when spawning MT_PLAYER, set mobj->player before calling MobjSpawn hook to prevent P_RemoveMobj from succeeding on player mobj.
|
||||
va_start(args, type);
|
||||
mobj->player = va_arg(args, player_t *);
|
||||
if (mobj->player)
|
||||
mobj->player->mo = mobj;
|
||||
va_end(args);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue