Move hook into G_SpawnPlayer

This commit is contained in:
wolfy852 2016-02-25 22:28:19 -06:00
parent 000ec9ac67
commit 5c9aaf2fe4
3 changed files with 7 additions and 6 deletions

View file

@ -2328,6 +2328,12 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
} }
} }
P_MovePlayerToSpawn(playernum, spawnpoint); P_MovePlayerToSpawn(playernum, spawnpoint);
#ifdef HAVE_BLUA
player_t *p = &players[playernum];
LUAh_PlayerSpawn(p); // Lua hook for player spawning :)
#endif
} }
mapthing_t *G_FindCTFStart(INT32 playernum) mapthing_t *G_FindCTFStart(INT32 playernum)

View file

@ -76,6 +76,6 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_B
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for P_SpawnPlayer #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer
#endif #endif

View file

@ -8294,11 +8294,6 @@ void P_SpawnPlayer(INT32 playernum)
// Spawn with a pity shield if necessary. // Spawn with a pity shield if necessary.
P_DoPityCheck(p); P_DoPityCheck(p);
#ifdef HAVE_BLUA
LUAh_PlayerSpawn(p); // Lua hook for player spawning :)
#endif
} }
void P_AfterPlayerSpawn(INT32 playernum) void P_AfterPlayerSpawn(INT32 playernum)