mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 03:30:50 +00:00
Merge branch 'lua-archive-value-fix' into 'next'
Lua archive value fix This fixes some potential problems with archiving mobjinfo_t/state_t data via Lua in netgames (whether as custom mobj/player vars or by NetVars hook). Thanks to LJSonic for pointing this out to me. See merge request !200
This commit is contained in:
commit
298c1af045
1 changed files with 2 additions and 2 deletions
|
@ -566,14 +566,14 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
||||||
{
|
{
|
||||||
mobjinfo_t *info = *((mobjinfo_t **)lua_touserdata(gL, myindex));
|
mobjinfo_t *info = *((mobjinfo_t **)lua_touserdata(gL, myindex));
|
||||||
WRITEUINT8(save_p, ARCH_MOBJINFO);
|
WRITEUINT8(save_p, ARCH_MOBJINFO);
|
||||||
WRITEUINT8(save_p, info - mobjinfo);
|
WRITEUINT16(save_p, info - mobjinfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ARCH_STATE:
|
case ARCH_STATE:
|
||||||
{
|
{
|
||||||
state_t *state = *((state_t **)lua_touserdata(gL, myindex));
|
state_t *state = *((state_t **)lua_touserdata(gL, myindex));
|
||||||
WRITEUINT8(save_p, ARCH_STATE);
|
WRITEUINT8(save_p, ARCH_STATE);
|
||||||
WRITEUINT8(save_p, state - states);
|
WRITEUINT16(save_p, state - states);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ARCH_MOBJ:
|
case ARCH_MOBJ:
|
||||||
|
|
Loading…
Reference in a new issue