Merge branch 'Lua-playerspawn-hook-fix' into 'next'

Fix for Lua's "PlayerSpawn" hook

This fixes how functions for the "PlayerSpawn" Lua hook aren't called when the player respawns at a starpost instead of at a map thing start.

(Note to Lua scripters who may want to adjust their scripts accordingly with this in future, checking if `player.starposttime` is non-zero is the best way to detect if you're spawning at a starpost or not.)

See merge request !198
This commit is contained in:
Monster Iestyn 2017-06-22 17:25:46 -04:00
commit 8ab4b8c7fe

View file

@ -2288,6 +2288,9 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
if (starpost) //Don't even bother with looking for a place to spawn. if (starpost) //Don't even bother with looking for a place to spawn.
{ {
P_MovePlayerToStarpost(playernum); P_MovePlayerToStarpost(playernum);
#ifdef HAVE_BLUA
LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
#endif
return; return;
} }