mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 09:11:59 +00:00
Assign a server player in replays for Lua purposes
Unfortunately this doesn't seem to help sync much. It at least prevents constant Lua errors I guess....
This commit is contained in:
parent
766ceabf91
commit
d560fef930
2 changed files with 4 additions and 2 deletions
|
@ -9812,7 +9812,7 @@ static inline int lib_getenum(lua_State *L)
|
||||||
lua_pushinteger(L, mapmusflags);
|
lua_pushinteger(L, mapmusflags);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (fastcmp(word,"server")) {
|
} else if (fastcmp(word,"server")) {
|
||||||
if ((!multiplayer || !netgame) && !playeringame[serverplayer])
|
if ((!multiplayer || !(netgame || demoplayback)) && !playeringame[serverplayer])
|
||||||
return 0;
|
return 0;
|
||||||
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -6847,6 +6847,8 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
// Load players that were in-game when the map started
|
// Load players that were in-game when the map started
|
||||||
p = READUINT8(demo_p);
|
p = READUINT8(demo_p);
|
||||||
|
|
||||||
|
secondarydisplayplayer = thirddisplayplayer = fourthdisplayplayer = INT32_MAX;
|
||||||
|
|
||||||
while (p != 0xFF)
|
while (p != 0xFF)
|
||||||
{
|
{
|
||||||
spectator = false;
|
spectator = false;
|
||||||
|
@ -6857,7 +6859,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
slots[numslots] = p; numslots++;
|
slots[numslots] = p; numslots++;
|
||||||
|
|
||||||
if (!playeringame[displayplayer] || players[displayplayer].spectator)
|
if (!playeringame[displayplayer] || players[displayplayer].spectator)
|
||||||
displayplayer = consoleplayer = secondarydisplayplayer = thirddisplayplayer = fourthdisplayplayer = p;
|
displayplayer = consoleplayer = serverplayer = p;
|
||||||
/*else if (!spectator && splitscreen < 3) {
|
/*else if (!spectator && splitscreen < 3) {
|
||||||
if (splitscreen == 0) {
|
if (splitscreen == 0) {
|
||||||
splitscreen = 1;
|
splitscreen = 1;
|
||||||
|
|
Loading…
Reference in a new issue