mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 09:11:21 +00:00
Fix segfault when trying to access mo->player->mo from SpawnMobj hook
This commit is contained in:
parent
279820cd6c
commit
fe75a21bef
1 changed files with 1 additions and 0 deletions
|
@ -10865,6 +10865,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.
|
// when spawning MT_PLAYER, set mobj->player before calling MobjSpawn hook to prevent P_RemoveMobj from succeeding on player mobj.
|
||||||
va_start(args, type);
|
va_start(args, type);
|
||||||
mobj->player = va_arg(args, player_t *);
|
mobj->player = va_arg(args, player_t *);
|
||||||
|
mobj->player->mo = mobj;
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue