mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +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,7 +10886,8 @@ 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 *);
|
||||
mobj->player->mo = mobj;
|
||||
if (mobj->player)
|
||||
mobj->player->mo = mobj;
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue