From c751971d57a347e11b008af2e26e1cafbab653a5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 2 Jul 2017 16:50:11 +0100 Subject: [PATCH] Fix integer type slipup in ArchiveValue for saving mobjinfo/state #s that LJSonic spotted Apart from the fact that UnArchiveValue reads UINT16 for both anyway (which alone causes problems), but UINT8 isn't even enough to store the higher end of the object types list and definitely most of the states welp --- src/lua_script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index acb306827..991b8fcf9 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -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: