diff --git a/src/hashtable.c b/src/hashtable.c index cb086d384b3964513db518eca1954b14147ebcd4..9a3f97f9b6880f2698d81222381b1f004ef80540 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -69,16 +69,13 @@ void mobjnum_ht_linkedList_AddEntry (thinker_t* thinker) { if (!currentEntry->thinker) { - // CONS_Printf("mobj not exists, adding\n"); currentEntry->thinker = thinker; break; } else { - // CONS_Printf("mobj exists, go next\n"); if (!currentEntry->next) { - // CONS_Printf("next not exists, create\n"); currentEntry->next = malloc(sizeof(mobjnum_linkedList)); currentEntry->next->thinker = thinker; currentEntry->next->next = NULL; diff --git a/src/lua_script.c b/src/lua_script.c index 86adc36e5eecca261a4c70261115288920e6234e..819ff696e33b9996b3590783e0ef67b6f5fc80d3 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -36,6 +36,7 @@ #include "doomstat.h" #include "g_state.h" +#include "p_savenetrb.h" //for P_FindNewPosition_Hashtable #include "hashtable.h" lua_State *gL = NULL; @@ -1455,7 +1456,7 @@ static UINT8 UnArchiveValue(int TABLESINDEX) LUA_PushUserdata(gL, &states[READUINT16(save_p)], META_STATE); break; case ARCH_MOBJ: - LUA_PushUserdata(gL, P_FindNewPosition(READUINT32(save_p)), META_MOBJ); + LUA_PushUserdata(gL, P_FindNewPosition_Hashtable(READUINT32(save_p)), META_MOBJ); break; case ARCH_PLAYER: LUA_PushUserdata(gL, &players[READUINT8(save_p)], META_PLAYER); diff --git a/src/p_savenetrb.h b/src/p_savenetrb.h index 27dc01c1c6180e8929c824b6367357075ae1581e..a67026d150a207ec29ca4b9faeb56c8200fb73ad 100755 --- a/src/p_savenetrb.h +++ b/src/p_savenetrb.h @@ -24,5 +24,6 @@ extern char netDebugText[10000]; // TODO: Find GPLv2 hashtable library and optimize the lua object loading code void P_GameStateFreeMemory(savestate_t* savestate); void P_SaveGameState(savestate_t* savestate); +mobj_t *P_FindNewPosition_Hashtable(UINT32 oldposition); boolean P_LoadGameState(const savestate_t* savestate); \ No newline at end of file