Merge branch 'fix-joiner-consoleplayer' into 'next'
Fix consoleplayer returning the server player during joining phase See merge request STJr/SRB2!1396
This commit is contained in:
commit
481ddb6532
|
@ -1678,7 +1678,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
// At this point, cmd doesn't contain the final angle yet,
|
// At this point, cmd doesn't contain the final angle yet,
|
||||||
// So we need to temporarily transform it so Lua scripters
|
// So we need to temporarily transform it so Lua scripters
|
||||||
// don't need to handle it differently than in other hooks.
|
// don't need to handle it differently than in other hooks.
|
||||||
if (gamestate == GS_LEVEL)
|
if (addedtogame && gamestate == GS_LEVEL)
|
||||||
{
|
{
|
||||||
INT16 extra = ticcmd_oldangleturn[forplayer] - player->oldrelangleturn;
|
INT16 extra = ticcmd_oldangleturn[forplayer] - player->oldrelangleturn;
|
||||||
INT16 origangle = cmd->angleturn;
|
INT16 origangle = cmd->angleturn;
|
||||||
|
|
|
@ -333,7 +333,7 @@ int LUA_PushGlobals(lua_State *L, const char *word)
|
||||||
return 1;
|
return 1;
|
||||||
// local player variables, by popular request
|
// local player variables, by popular request
|
||||||
} else if (fastcmp(word,"consoleplayer")) { // player controlling console (aka local player 1)
|
} else if (fastcmp(word,"consoleplayer")) { // player controlling console (aka local player 1)
|
||||||
if (consoleplayer < 0 || !playeringame[consoleplayer])
|
if (!addedtogame || consoleplayer < 0 || !playeringame[consoleplayer])
|
||||||
return 0;
|
return 0;
|
||||||
LUA_PushUserdata(L, &players[consoleplayer], META_PLAYER);
|
LUA_PushUserdata(L, &players[consoleplayer], META_PLAYER);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue