Skip to content
Snippets Groups Projects
Commit 298c1af0 authored by Monster Iestyn's avatar Monster Iestyn
Browse files

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
parents 663d8a1f c751971d
No related branches found
No related tags found
2 merge requests!252OpenGL: Public flatsprite: The Fixening,!203Fixes for Each Time and P_IsObjectOnGroundIn
......@@ -566,14 +566,14 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
{
mobjinfo_t *info = *((mobjinfo_t **)lua_touserdata(gL, myindex));
WRITEUINT8(save_p, ARCH_MOBJINFO);
WRITEUINT8(save_p, info - mobjinfo);
WRITEUINT16(save_p, info - mobjinfo);
break;
}
case ARCH_STATE:
{
state_t *state = *((state_t **)lua_touserdata(gL, myindex));
WRITEUINT8(save_p, ARCH_STATE);
WRITEUINT8(save_p, state - states);
WRITEUINT16(save_p, state - states);
break;
}
case ARCH_MOBJ:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment