diff --git a/src/acs/call-funcs.cpp b/src/acs/call-funcs.cpp index d06fb555b..eb1193155 100644 --- a/src/acs/call-funcs.cpp +++ b/src/acs/call-funcs.cpp @@ -660,7 +660,7 @@ bool CallFunc_ThingCount(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM:: for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) { continue; } diff --git a/src/d_clisrv.c b/src/d_clisrv.c index cd2123507..6efd6e9b5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5363,7 +5363,7 @@ static INT16 Consistancy(void) { for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 8320d9b49..00a5c4aa0 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -6462,7 +6462,7 @@ static void Command_Archivetest_f(void) // assign mobjnum i = 1; for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) + if (th->function != (actionf_p1)P_RemoveThinkerDelayed) ((mobj_t *)th)->mobjnum = i++; // allocate buffer diff --git a/src/d_think.h b/src/d_think.h index 42dca1965..181745dd9 100644 --- a/src/d_think.h +++ b/src/d_think.h @@ -28,18 +28,11 @@ extern "C" { // To compile this as "ANSI C with classes" we will need to handle the various // action functions cleanly. // -typedef void (*actionf_v)(); typedef void (*actionf_p1)(void *); -typedef union -{ - actionf_v acv; - actionf_p1 acp1; -} actionf_t; - // Historically, "think_t" is yet another function pointer to a routine // to handle an actor. -typedef actionf_t think_t; +typedef actionf_p1 think_t; // Doubly linked list of actors. struct thinker_t diff --git a/src/deh_lua.c b/src/deh_lua.c index 5b00d1e2a..9200caf1f 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -75,14 +75,14 @@ static inline int lib_freeslot(lua_State *L) // Arguments: mobj_t actor, int var1, int var2 static int action_call(lua_State *L) { - //actionf_t *action = lua_touserdata(L,lua_upvalueindex(1)); - actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION)); + //actionf_p1 *action = lua_touserdata(L,lua_upvalueindex(1)); + actionf_p1 *action = *((actionf_p1 **)luaL_checkudata(L, 1, META_ACTION)); mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ)); var1 = (INT32)luaL_optinteger(L, 3, 0); var2 = (INT32)luaL_optinteger(L, 4, 0); if (!actor) return LUA_ErrInvalid(L, "mobj_t"); - action->acp1(actor); + (*action)(actor); return 0; } @@ -520,7 +520,7 @@ static inline int lib_getenum(lua_State *L) // Retrieving them from this metatable allows them to be case-insensitive! for (i = 0; actionpointers[i].name; i++) if (fasticmp(word, actionpointers[i].name)) { - // We push the actionf_t* itself as userdata! + // We push the actionf_p1* itself as userdata! LUA_PushUserdata(L, &actionpointers[i].action, META_ACTION); return 1; } @@ -589,7 +589,7 @@ static int lib_getActionName(lua_State *L) { if (lua_isuserdata(L, 1)) // arg 1 is built-in action, expect action userdata { - actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION)); + actionf_p1 *action = *((actionf_p1 **)luaL_checkudata(L, 1, META_ACTION)); const char *name = NULL; if (!action) return luaL_error(L, "not a valid action?"); @@ -651,11 +651,11 @@ int LUA_SOCLib(lua_State *L) const char *LUA_GetActionName(void *action) { - actionf_t *act = (actionf_t *)action; + actionf_p1 *act = (actionf_p1 *)action; size_t z; for (z = 0; actionpointers[z].name; z++) { - if (actionpointers[z].action.acv == act->acv) + if (actionpointers[z].action == *act) return actionpointers[z].name; } return NULL; @@ -670,8 +670,6 @@ void LUA_SetActionByName(void *state, const char *actiontocompare) if (fasticmp(actiontocompare, actionpointers[z].name)) { st->action = actionpointers[z].action; - st->action.acv = actionpointers[z].action.acv; // assign - st->action.acp1 = actionpointers[z].action.acp1; return; } } diff --git a/src/deh_soc.c b/src/deh_soc.c index 88f5675ed..f51d52eb7 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2453,25 +2453,25 @@ void readframe(MYFILE *f, INT32 num) for (z = 0; actionpointers[z].name; z++) { - if (actionpointers[z].action.acv == states[num].action.acv) + if (actionpointers[z].action == states[num].action) break; } z = 0; found = LUA_SetLuaAction(&states[num], actiontocompare); if (!found) + { while (actionpointers[z].name) { if (fastcmp(actiontocompare, actionpointers[z].name)) { states[num].action = actionpointers[z].action; - states[num].action.acv = actionpointers[z].action.acv; // assign - states[num].action.acp1 = actionpointers[z].action.acp1; found = true; break; } z++; } + } if (!found) deh_warning("Unknown action %s", actiontocompare); diff --git a/src/deh_tables.c b/src/deh_tables.c index b2d807ade..bdee2e2b4 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -141,14 +141,14 @@ struct flickytypes_s FLICKYTYPES[] = { actionpointer_t actionpointers[] = { -#define _(name, upper, ...) {{name}, "A_"#upper}, +#define _(name, upper, ...) {name, "A_"#upper}, #include "info/actions.h" #undef _ - {{NULL}, "NONE"}, + {NULL, "NONE"}, // This NULL entry must be the last in the list - {{NULL}, NULL}, + {NULL, NULL}, }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/deh_tables.h b/src/deh_tables.h index 9a03ae68d..436eae71f 100644 --- a/src/deh_tables.h +++ b/src/deh_tables.h @@ -14,7 +14,7 @@ #define __DEH_TABLES_H__ #include "doomdef.h" // Constants -#include "d_think.h" // actionf_t +#include "d_think.h" // actionf_p1 #include "info.h" // Mobj, state, sprite, etc constants #include "lua_script.h" #include "strbuf.h" @@ -53,7 +53,7 @@ struct flickytypes_s { */ struct actionpointer_t { - actionf_t action; ///< Function pointer corresponding to the actual action. + actionf_p1 action; ///< Function pointer corresponding to the actual action. const char *name; ///< Name of the action in ALL CAPS. }; diff --git a/src/f_finale.c b/src/f_finale.c index 350df9699..b6cf41e64 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1619,7 +1619,7 @@ void F_TitleScreenTicker(boolean run) { for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; diff --git a/src/g_demo.c b/src/g_demo.c index 29a275507..561e8469e 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -1866,7 +1866,7 @@ void G_ConsGhostTic(INT32 playernum) thinker_t *th = NULL; for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mobj = (mobj_t *)th; if (mobj->type == damage->type && mobj->x == damage->x && mobj->y == damage->y && mobj->z == damage->z) @@ -4140,7 +4140,7 @@ void G_DoPlayMetal(void) // find metal sonic for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; diff --git a/src/g_game.c b/src/g_game.c index 23a1fbfcc..174dc8aeb 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3439,7 +3439,7 @@ void G_ChangePlayerReferences(mobj_t *oldmo, mobj_t *newmo) // scan all thinkers for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index bdf2f026b..b93e9c563 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -918,7 +918,7 @@ static void HWR_PrecacheLevelSprites(void) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) + if (th->function != (actionf_p1)P_MobjThinker) continue; mo = (mobj_t *)th; diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index e66953b4f..e3e3e67e2 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -1412,7 +1412,7 @@ static void HWR_SearchLightsInMobjs(void) // search in the list of thinkers for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) + if (th->function != (actionf_p1)P_RemoveThinkerDelayed) HWR_AddMobjLights((mobj_t *)th); } #endif diff --git a/src/info.h b/src/info.h index 85cb1dd6d..fca10c158 100644 --- a/src/info.h +++ b/src/info.h @@ -36,7 +36,7 @@ enum actionnum { }; // function prototypes for actions -#define _(name, upper, ...) void name(mobj_t *actor); +#define _(name, upper, ...) void name(void *thing); #include "info/actions.h" #undef _ @@ -84,7 +84,7 @@ struct state_t spritenum_t sprite; UINT32 frame; // we use the upper 16 bits for translucency and other shade effects INT32 tics; - actionf_t action; + actionf_p1 action; INT32 var1; INT32 var2; statenum_t nextstate; diff --git a/src/k_battle.c b/src/k_battle.c index e37cfee39..62bf544b5 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -374,7 +374,7 @@ void K_RunPaperItemSpawners(void) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; @@ -537,7 +537,7 @@ void K_RespawnBattleBoxes(void) mobj_t *box; mobj_t *newmobj; - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; box = (mobj_t *)th; diff --git a/src/k_kart.c b/src/k_kart.c index bc7874537..d6ac28a47 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -11201,7 +11201,7 @@ boolean K_IsSPBInGame(void) // spbplace is still -1 until a fired SPB finds a target, so look for an in-map SPB just in case for (think = thlist[THINK_MOBJ].next; think != &thlist[THINK_MOBJ]; think = think->next) { - if (think->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (think->function == (actionf_p1)P_RemoveThinkerDelayed) continue; if (((mobj_t *)think)->type == MT_SPB) diff --git a/src/k_waypoint.cpp b/src/k_waypoint.cpp index 8f9f72574..751aa427d 100644 --- a/src/k_waypoint.cpp +++ b/src/k_waypoint.cpp @@ -3056,7 +3056,7 @@ void K_AdjustWaypointsParameters (void) th != &thlist[THINK_MOBJ]; th = th->next ){ - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; anchor = (const mobj_t *)th; diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 4cf0e413f..b830ab3b8 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -780,21 +780,19 @@ static int lib_setState(lua_State *L) switch(lua_type(L, 3)) { case LUA_TNIL: // Null? Set the action to nothing, then. - state->action.acp1 = NULL; + state->action = NULL; break; case LUA_TSTRING: // It's a string, expect the name of a built-in action LUA_SetActionByName(state, lua_tostring(L, 3)); break; case LUA_TUSERDATA: // It's a userdata, expect META_ACTION of a built-in action { - actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION)); + actionf_p1 *action = *((actionf_p1 **)luaL_checkudata(L, 3, META_ACTION)); if (!action) return luaL_error(L, "not a valid action?"); state->action = *action; - state->action.acv = action->acv; - state->action.acp1 = action->acp1; break; } case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!) @@ -804,7 +802,7 @@ static int lib_setState(lua_State *L) lua_pushvalue(L, 3); // Bring it to the top of the stack lua_rawset(L, -3); // Set it in the registry lua_pop(L, 1); // pop LREG_STATEACTION - state->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata. + state->action = (actionf_p1)A_Lua; // Set the action for the userdata. break; default: // ?! return luaL_typerror(L, 3, "function"); @@ -862,7 +860,7 @@ boolean LUA_SetLuaAction(void *stv, const char *action) lua_pop(gL, 1); // pop LREG_STATEACTION lua_pop(gL, 2); // pop the function and LREG_ACTIONS - st->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata. + st->action = (actionf_p1)A_Lua; // Set the action for the userdata. return true; // action successfully set. } @@ -929,9 +927,9 @@ static int state_get(lua_State *L) number = st->tics; else if (fastcmp(field,"action")) { const char *name; - if (!st->action.acp1) // Action is NULL. + if (!st->action) // Action is NULL. return 0; // return nil. - if (st->action.acp1 == (actionf_p1)A_Lua) { // This is a Lua function? + if (st->action == (actionf_p1)A_Lua) { // This is a Lua function? lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION); I_Assert(lua_istable(L, -1)); lua_pushlightuserdata(L, st); // Push the state pointer and @@ -948,9 +946,9 @@ static int state_get(lua_State *L) return 1; // return just the function #ifdef DEVELOP } else if (fastcmp(field,"actionname")) { - if (!st->action.acp1) { // Action is NULL. + if (!st->action) { // Action is NULL. lua_pushstring(L, "NULL"); - } else if (st->action.acp1 == (actionf_p1)A_Lua) { // This is a Lua function? + } else if (st->action == (actionf_p1)A_Lua) { // This is a Lua function? lua_Debug ar; lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION); I_Assert(lua_istable(L, -1)); @@ -1019,21 +1017,19 @@ static int state_set(lua_State *L) switch(lua_type(L, 3)) { case LUA_TNIL: // Null? Set the action to nothing, then. - st->action.acp1 = NULL; + st->action = NULL; break; case LUA_TSTRING: // It's a string, expect the name of a built-in action LUA_SetActionByName(st, lua_tostring(L, 3)); break; case LUA_TUSERDATA: // It's a userdata, expect META_ACTION of a built-in action { - actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION)); + actionf_p1 *action = *((actionf_p1 **)luaL_checkudata(L, 3, META_ACTION)); if (!action) return luaL_error(L, "not a valid action?"); st->action = *action; - st->action.acv = action->acv; - st->action.acp1 = action->acp1; break; } case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!) @@ -1043,7 +1039,7 @@ static int state_set(lua_State *L) lua_pushvalue(L, 3); // Bring it to the top of the stack lua_rawset(L, -3); // Set it in the registry lua_pop(L, 1); // pop LREG_STATEACTION - st->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata. + st->action = (actionf_p1)A_Lua; // Set the action for the userdata. break; default: // ?! return luaL_typerror(L, 3, "function"); diff --git a/src/lua_libs.h b/src/lua_libs.h index 7dbfbef38..bcde88696 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -96,7 +96,7 @@ extern lua_State *gL; #define META_COLORMAP "COLORMAP" #define META_CAMERA "CAMERA_T*" -#define META_ACTION "ACTIONF_T*" +#define META_ACTION "actionf_p1*" #define META_LUABANKS "LUABANKS[]*" diff --git a/src/lua_script.c b/src/lua_script.c index 387f6023f..393699177 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -1944,7 +1944,7 @@ void LUA_Sync(savebuffer_t *save, boolean network, boolean compat) { for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; // archive function will determine when to skip mobjs, @@ -1968,7 +1968,7 @@ void LUA_Sync(savebuffer_t *save, boolean network, boolean compat) mobjnum = READUINT32(save->p); // read a mobjnum for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; if (((mobj_t *)th)->mobjnum != mobjnum) // find matching mobj continue; diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c index a51b62330..6404fa0df 100644 --- a/src/lua_thinkerlib.c +++ b/src/lua_thinkerlib.c @@ -44,7 +44,7 @@ static int iterationState_gc(lua_State *L) } #define push_thinker(th) {\ - if ((th)->function.acp1 == (actionf_p1)P_MobjThinker) \ + if ((th)->function == (actionf_p1)P_MobjThinker) \ LUA_PushUserdata(L, (th), META_MOBJ); \ else \ lua_pushlightuserdata(L, (th)); \ @@ -93,7 +93,7 @@ static int lib_iterateThinkers(lua_State *L) return luaL_error(L, "next thinker invalidated during iteration"); for (; next != &thlist[THINK_MOBJ]; next = next->next) - if (!it->filter || next->function.acp1 == it->filter) + if (!it->filter || next->function == it->filter) { push_thinker(next); if (next->next != &thlist[THINK_MOBJ]) diff --git a/src/m_cheat.c b/src/m_cheat.c index a36e9ff1b..001d26832 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -440,7 +440,7 @@ void Command_ATeleport_f(void) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -948,7 +948,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; diff --git a/src/m_perfstats.c b/src/m_perfstats.c index 93ae55800..489bbb4c6 100644 --- a/src/m_perfstats.c +++ b/src/m_perfstats.c @@ -438,7 +438,7 @@ static void M_DrawTickStats(void) for (thinker = thlist[i].next; thinker != &thlist[i]; thinker = thinker->next) { thinkercount++; - if (thinker->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (thinker->function == (actionf_p1)P_RemoveThinkerDelayed) removecount++; else if (i == THINK_POLYOBJ) polythcount++; @@ -446,7 +446,7 @@ static void M_DrawTickStats(void) mainthcount++; else if (i == THINK_MOBJ) { - if (thinker->function.acp1 == (actionf_p1)P_MobjThinker) + if (thinker->function == (actionf_p1)P_MobjThinker) { mobj_t *mobj = (mobj_t*)thinker; mobjcount++; diff --git a/src/p_ceilng.c b/src/p_ceilng.c index 8c6d01185..cebb160e2 100644 --- a/src/p_ceilng.c +++ b/src/p_ceilng.c @@ -323,7 +323,7 @@ INT32 EV_DoCeilingOLD(mtag_t tag, line_t *line, ceiling_e type) ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &ceiling->thinker); sec->ceilingdata = ceiling; - ceiling->thinker.function.acp1 = (actionf_p1)T_MoveCeiling; + ceiling->thinker.function = (actionf_p1)T_MoveCeiling; ceiling->sector = sec; ceiling->crush = false; ceiling->sourceline = (INT32)(line-lines); @@ -465,7 +465,7 @@ static ceiling_t *CreateCeilingThinker(sector_t *sec) sec->ceilingdata = ceiling; - ceiling->thinker.function.acp1 = (actionf_p1)T_MoveCeiling; + ceiling->thinker.function = (actionf_p1)T_MoveCeiling; ceiling->sector = sec; ceiling->crush = false; @@ -799,7 +799,7 @@ INT32 EV_DoCrushOLD(mtag_t tag, line_t *line, ceiling_e type) ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &ceiling->thinker); sec->ceilingdata = ceiling; - ceiling->thinker.function.acp1 = (actionf_p1)T_CrushCeiling; + ceiling->thinker.function = (actionf_p1)T_CrushCeiling; ceiling->sector = sec; ceiling->crush = true; ceiling->sourceline = (INT32)(line-lines); @@ -853,7 +853,7 @@ static ceiling_t *CreateCrushThinker(sector_t *sec) sec->ceilingdata = ceiling; - ceiling->thinker.function.acp1 = (actionf_p1)T_MoveCeiling; + ceiling->thinker.function = (actionf_p1)T_MoveCeiling; ceiling->sector = sec; ceiling->crush = true; diff --git a/src/p_enemy.c b/src/p_enemy.c index 36ce44d69..a26f26467 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -35,7 +35,7 @@ #include "hardware/hw3sound.h" #endif -boolean LUA_CallAction(enum actionnum actionnum, mobj_t *actor); +boolean LUA_CallAction(enum actionnum actionnum, void *actor); INT32 var1; INT32 var2; @@ -565,8 +565,9 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target // upper 16 bits = distance limit // var2 = If 1, only change to seestate. If 2, only play seesound. If 0, do both. // -void A_Look(mobj_t *actor) +void A_Look(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -601,8 +602,9 @@ void A_Look(mobj_t *actor) // 3 = don't check meleestate and missilestate // var2 = unused // -void A_Chase(mobj_t *actor) +void A_Chase(void *thing) { + mobj_t *actor = thing; INT32 delta; INT32 locvar1 = var1; @@ -693,8 +695,9 @@ nomissile: // var1 = unused // var2 = unused // -void A_FaceStabChase(mobj_t *actor) +void A_FaceStabChase(void *thing) { + mobj_t *actor = thing; INT32 delta; if (LUA_CallAction(A_FACESTABCHASE, actor)) @@ -774,7 +777,7 @@ nomissile: P_NewChaseDir(actor); } -static void P_SharpDust(mobj_t *actor, mobjtype_t type, angle_t ang) +static void P_SharpDust(void *actor, mobjtype_t type, angle_t ang) { mobj_t *dust; @@ -795,8 +798,9 @@ static void P_SharpDust(mobj_t *actor, mobjtype_t type, angle_t ang) // var1 = object to create // var2 = effective nextstate for created object // -void A_StatueBurst(mobj_t *actor) +void A_StatueBurst(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobjtype_t chunktype = (mobjtype_t)actor->info->raisestate; @@ -850,8 +854,9 @@ void A_StatueBurst(mobj_t *actor) // var1 = unused // var2 = unused // -void A_JetJawRoam(mobj_t *actor) +void A_JetJawRoam(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_JETJAWROAM, actor)) return; @@ -877,8 +882,9 @@ void A_JetJawRoam(mobj_t *actor) // var1 = unused // var2 = unused // -void A_JetJawChomp(mobj_t *actor) +void A_JetJawChomp(void *thing) { + mobj_t *actor = thing; INT32 delta; if (LUA_CallAction(A_JETJAWCHOMP, actor)) @@ -916,8 +922,9 @@ void A_JetJawChomp(mobj_t *actor) // var1 = unused // var2 = unused // -void A_PointyThink(mobj_t *actor) +void A_PointyThink(void *thing) { + mobj_t *actor = thing; INT32 i; player_t *player = NULL; mobj_t *ball; @@ -1022,8 +1029,9 @@ void A_PointyThink(mobj_t *actor) // 1 = tracer // var2 = unused // -void A_CheckBuddy(mobj_t *actor) +void A_CheckBuddy(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_CHECKBUDDY, actor)) @@ -1042,8 +1050,9 @@ void A_CheckBuddy(mobj_t *actor) // var1 = unused // var2 = unused // -void A_HoodThink(mobj_t *actor) +void A_HoodThink(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_HOODTHINK, actor)) return; @@ -1099,8 +1108,9 @@ void A_HoodThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_ArrowCheck(mobj_t *actor) +void A_ArrowCheck(void *thing) { + mobj_t *actor = thing; fixed_t x,y,z; angle_t angle; fixed_t dist; @@ -1141,8 +1151,9 @@ void A_ArrowCheck(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SnailerThink(mobj_t *actor) +void A_SnailerThink(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SNAILERTHINK, actor)) return; @@ -1214,8 +1225,9 @@ void A_SnailerThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SharpChase(mobj_t *actor) +void A_SharpChase(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SHARPCHASE, actor)) return; @@ -1266,8 +1278,9 @@ void A_SharpChase(mobj_t *actor) // var1 = object # to spawn as dust (if not provided not done) // var2 = if nonzero, do the old-style spinning using this as the angle difference // -void A_SharpSpin(mobj_t *actor) +void A_SharpSpin(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; angle_t oldang = actor->angle; @@ -1303,8 +1316,9 @@ void A_SharpSpin(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SharpDecel(mobj_t *actor) +void A_SharpDecel(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SHARPDECEL, actor)) return; @@ -1324,8 +1338,9 @@ void A_SharpDecel(mobj_t *actor) // var1 = speed (actor info's speed if 0) // var2 = state to switch to when blocked (spawnstate if 0) // -void A_CrushstaceanWalk(mobj_t *actor) +void A_CrushstaceanWalk(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = (var1 ? var1 : (INT32)actor->info->speed); INT32 locvar2 = (var2 ? var2 : (INT32)actor->info->spawnstate); angle_t ang = actor->angle + ((actor->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270); @@ -1355,8 +1370,9 @@ void A_CrushstaceanWalk(mobj_t *actor) // var1 = unused // var2 = state to go to if unsuccessful (spawnstate if 0) // -void A_CrushstaceanPunch(mobj_t *actor) +void A_CrushstaceanPunch(void *thing) { + mobj_t *actor = thing; INT32 locvar2 = (var2 ? var2 : (INT32)actor->info->spawnstate); if (LUA_CallAction(A_CRUSHSTACEANPUNCH, actor)) @@ -1384,8 +1400,9 @@ void A_CrushstaceanPunch(mobj_t *actor) // var1 = sideways offset // var2 = vertical offset // -void A_CrushclawAim(mobj_t *actor) +void A_CrushclawAim(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *crab = actor->tracer; @@ -1446,8 +1463,9 @@ void A_CrushclawAim(mobj_t *actor) // anything else - backwards // var2 = state to change to when done // -void A_CrushclawLaunch(mobj_t *actor) +void A_CrushclawLaunch(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *crab = actor->tracer; @@ -1581,8 +1599,9 @@ void A_CrushclawLaunch(mobj_t *actor) // var1 = unused // var2 = unused // -void A_VultureVtol(mobj_t *actor) +void A_VultureVtol(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_VULTUREVTOL, actor)) return; @@ -1616,8 +1635,9 @@ void A_VultureVtol(mobj_t *actor) // var1 = unused // var2 = unused // -void A_VultureCheck(mobj_t *actor) +void A_VultureCheck(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_VULTURECHECK, actor)) return; @@ -1640,8 +1660,9 @@ void A_VultureCheck(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SkimChase(mobj_t *actor) +void A_SkimChase(void *thing) { + mobj_t *actor = thing; INT32 delta; if (LUA_CallAction(A_SKIMCHASE, actor)) @@ -1728,8 +1749,9 @@ nomissile: // var1 = unused // var2 = unused // -void A_FaceTarget(mobj_t *actor) +void A_FaceTarget(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_FACETARGET, actor)) return; @@ -1746,8 +1768,9 @@ void A_FaceTarget(mobj_t *actor) // var1 = unused // var2 = unused // -void A_FaceTracer(mobj_t *actor) +void A_FaceTracer(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_FACETRACER, actor)) return; @@ -1766,8 +1789,9 @@ void A_FaceTracer(mobj_t *actor) // var2 >> 16 = height offset // var2 & 65535 = airtime // -void A_LobShot(mobj_t *actor) +void A_LobShot(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2 >> 16; mobj_t *shot; @@ -1866,8 +1890,9 @@ void A_LobShot(mobj_t *actor) // var1 = object # to shoot // var2 = height offset // -void A_FireShot(mobj_t *actor) +void A_FireShot(void *thing) { + mobj_t *actor = thing; fixed_t z; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -1903,8 +1928,9 @@ void A_FireShot(mobj_t *actor) // var1 = object # to shoot // var2 = height offset // -void A_SuperFireShot(mobj_t *actor) +void A_SuperFireShot(void *thing) { + mobj_t *actor = thing; fixed_t z; mobj_t *mo; INT32 locvar1 = var1; @@ -1950,8 +1976,9 @@ void A_SuperFireShot(mobj_t *actor) // 4 - Boss 3 Right side upper // 5 - Boss 3 Right side lower // -void A_BossFireShot(mobj_t *actor) +void A_BossFireShot(void *thing) { + mobj_t *actor = thing; fixed_t x, y, z; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -2035,8 +2062,9 @@ void A_BossFireShot(mobj_t *actor) // var1 = object # to shoot // var2 = firing sound // -void A_Boss7FireMissiles(mobj_t *actor) +void A_Boss7FireMissiles(void *thing) { + mobj_t *actor = thing; mobj_t dummymo; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -2101,8 +2129,9 @@ void A_Boss7FireMissiles(mobj_t *actor) // 0 - Boss 1 Left side // 1 - Boss 1 Right side // -void A_Boss1Laser(mobj_t *actor) +void A_Boss1Laser(void *thing) { + mobj_t *actor = thing; fixed_t x, y, z, floorz, speed; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -2207,8 +2236,9 @@ void A_Boss1Laser(mobj_t *actor) // 1 - steady focus with fixed movement speed // var2 = unused // -void A_FocusTarget(mobj_t *actor) +void A_FocusTarget(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_FOCUSTARGET, actor)) @@ -2257,8 +2287,9 @@ void A_FocusTarget(mobj_t *actor) // var1 = sfx to play // var2 = sfx to play in pinch // -void A_Boss4Reverse(mobj_t *actor) +void A_Boss4Reverse(void *thing) { + mobj_t *actor = thing; sfxenum_t locvar1 = (sfxenum_t)var1; sfxenum_t locvar2 = (sfxenum_t)var2; @@ -2293,8 +2324,9 @@ void A_Boss4Reverse(mobj_t *actor) // var1 = sfx to play // var2 = unused // -void A_Boss4SpeedUp(mobj_t *actor) +void A_Boss4SpeedUp(void *thing) { + mobj_t *actor = thing; sfxenum_t locvar1 = (sfxenum_t)var1; if (LUA_CallAction(A_BOSS4SPEEDUP, actor)) @@ -2311,8 +2343,9 @@ void A_Boss4SpeedUp(mobj_t *actor) // var1 = sfx to play // var2 = unused // -void A_Boss4Raise(mobj_t *actor) +void A_Boss4Raise(void *thing) { + mobj_t *actor = thing; sfxenum_t locvar1 = (sfxenum_t)var1; if (LUA_CallAction(A_BOSS4RAISE, actor)) @@ -2337,8 +2370,9 @@ void A_Boss4Raise(mobj_t *actor) // #define SKULLSPEED (20*FRACUNIT) -void A_SkullAttack(mobj_t *actor) +void A_SkullAttack(void *thing) { + mobj_t *actor = thing; mobj_t *dest; angle_t an; INT32 dist; @@ -2453,8 +2487,9 @@ void A_SkullAttack(mobj_t *actor) // var1 = unused // var2 = unused // -void A_BossZoom(mobj_t *actor) +void A_BossZoom(void *thing) { + mobj_t *actor = thing; mobj_t *dest; angle_t an; INT32 dist; @@ -2490,8 +2525,9 @@ void A_BossZoom(mobj_t *actor) // & 2 - Use entire vertical range of object to spawn // var2 = Object to spawn. Default is MT_SONIC3KBOSSEXPLODE. // -void A_BossScream(mobj_t *actor) +void A_BossScream(void *thing) { + mobj_t *actor = thing; mobj_t *mo; fixed_t x, y, z; angle_t fa; @@ -2542,8 +2578,9 @@ void A_BossScream(mobj_t *actor) // var1 = unused // var2 = unused // -void A_Scream(mobj_t *actor) +void A_Scream(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SCREAM, actor)) return; @@ -2560,8 +2597,9 @@ void A_Scream(mobj_t *actor) // var1 = unused // var2 = unused // -void A_Pain(mobj_t *actor) +void A_Pain(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_PAIN, actor)) return; @@ -2579,8 +2617,9 @@ void A_Pain(mobj_t *actor) // var1 = value to set repeat to if nonzero // var2 = unused // -void A_Fall(mobj_t *actor) +void A_Fall(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_FALL, actor)) @@ -2606,8 +2645,9 @@ void A_Fall(mobj_t *actor) // var1 = unused // var2 = unused // -void A_MonitorPop(mobj_t *actor) +void A_MonitorPop(void *thing) { + mobj_t *actor = thing; mobj_t *remains; mobjtype_t explode; mobjtype_t item = 0; @@ -2702,8 +2742,9 @@ void A_MonitorPop(mobj_t *actor) // var1 = damagetype // var2 = unused // -void A_Explode(mobj_t *actor) +void A_Explode(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_EXPLODE, actor)) @@ -2747,7 +2788,7 @@ static void P_DoBossVictory(mobj_t *mo) // scan the remaining thinkers to see if all bosses are dead for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -2822,8 +2863,9 @@ static void P_DoBossDefaultDeath(mobj_t *mo) // var1 = unused // var2 = unused // -void A_BossDeath(mobj_t *mo) +void A_BossDeath(void *thing) { + mobj_t *mo = thing; INT32 i; if (LUA_CallAction(A_BOSSDEATH, mo)) @@ -2890,8 +2932,9 @@ void A_BossDeath(mobj_t *mo) // var1 = unused // var2 = unused // -void A_RingBox(mobj_t *actor) +void A_RingBox(void *thing) { + mobj_t *actor = thing; player_t *player; if (LUA_CallAction(A_RINGBOX, actor)) @@ -2917,8 +2960,9 @@ void A_RingBox(mobj_t *actor) // var1 = unused // var2 = unused // -void A_AwardScore(mobj_t *actor) +void A_AwardScore(void *thing) { + mobj_t *actor = thing; player_t *player; if (LUA_CallAction(A_AWARDSCORE, actor)) @@ -2944,8 +2988,9 @@ void A_AwardScore(mobj_t *actor) // var1 = unused // var2 = unused // -void A_ScoreRise(mobj_t *actor) +void A_ScoreRise(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SCORERISE, actor)) return; @@ -2960,8 +3005,9 @@ void A_ScoreRise(mobj_t *actor) // var1 = jump strength // var2 = horizontal movement // -void A_BunnyHop(mobj_t *actor) +void A_BunnyHop(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -2983,8 +3029,9 @@ void A_BunnyHop(mobj_t *actor) // var1 = Distance to look for players. If no player is in this distance, bubbles aren't spawned. (Ambush overrides) // var2 = unused // -void A_BubbleSpawn(mobj_t *actor) +void A_BubbleSpawn(void *thing) { + mobj_t *actor = thing; INT32 i, locvar1 = var1; UINT8 prandom; mobj_t *bubble = NULL; @@ -3035,8 +3082,9 @@ void A_BubbleSpawn(mobj_t *actor) // var1 = Distance to look for players. If no player is in this distance, bubbles aren't spawned. (Ambush overrides) // var2 = unused // -void A_FanBubbleSpawn(mobj_t *actor) +void A_FanBubbleSpawn(void *thing) { + mobj_t *actor = thing; INT32 i, locvar1 = var1; UINT8 prandom; mobj_t *bubble = NULL; @@ -3083,8 +3131,9 @@ void A_FanBubbleSpawn(mobj_t *actor) // 1 = Rise straight up // var2 = rising speed // -void A_BubbleRise(mobj_t *actor) +void A_BubbleRise(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -3122,8 +3171,9 @@ void A_BubbleRise(mobj_t *actor) // var1 = unused // var2 = unused // -void A_BubbleCheck(mobj_t *actor) +void A_BubbleCheck(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_BUBBLECHECK, actor)) return; @@ -3140,8 +3190,9 @@ void A_BubbleCheck(mobj_t *actor) // var1 = unused // var2 = unused // -void A_AttractChase(mobj_t *actor) +void A_AttractChase(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_ATTRACTCHASE, actor)) return; @@ -3366,8 +3417,9 @@ void A_AttractChase(mobj_t *actor) // lower 16 bits = proximity check distance (0 disables) // upper 16 bits = 0 to check proximity with target, 1 for tracer // -void A_DropMine(mobj_t *actor) +void A_DropMine(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t z; @@ -3416,8 +3468,9 @@ void A_DropMine(mobj_t *actor) // var1 = Jump strength (in FRACBITS), if specified. Otherwise, uses the angle value. // var2 = Trail object to spawn, if desired. // -void A_FishJump(mobj_t *actor) +void A_FishJump(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -3476,8 +3529,9 @@ void A_FishJump(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SetSolidSteam(mobj_t *actor) +void A_SetSolidSteam(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SETSOLIDSTEAM, actor)) return; @@ -3508,8 +3562,9 @@ void A_SetSolidSteam(mobj_t *actor) // var1 = unused // var2 = unused // -void A_UnsetSolidSteam(mobj_t *actor) +void A_UnsetSolidSteam(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_UNSETSOLIDSTEAM, actor)) return; @@ -3524,8 +3579,9 @@ void A_UnsetSolidSteam(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SignPlayer(mobj_t *actor) +void A_SignPlayer(void *thing) { + mobj_t *actor = thing; mobj_t *ov; if (LUA_CallAction(A_SIGNPLAYER, actor)) return; @@ -3554,8 +3610,9 @@ void A_SignPlayer(mobj_t *actor) // var1 = unused // var2 = invert, z offset // -void A_OverlayThink(mobj_t *actor) +void A_OverlayThink(void *thing) { + mobj_t *actor = thing; fixed_t destx, desty; if (LUA_CallAction(A_OVERLAYTHINK, actor)) @@ -3609,8 +3666,9 @@ void A_OverlayThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_JetChase(mobj_t *actor) +void A_JetChase(void *thing) { + mobj_t *actor = thing; fixed_t thefloor; if (LUA_CallAction(A_JETCHASE, actor)) @@ -3704,8 +3762,9 @@ void A_JetChase(mobj_t *actor) // var1 = unused // var2 = unused // -void A_JetbThink(mobj_t *actor) +void A_JetbThink(void *thing) { + mobj_t *actor = thing; sector_t *nextsector; fixed_t thefloor; @@ -3770,8 +3829,9 @@ void A_JetbThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_JetgShoot(mobj_t *actor) +void A_JetgShoot(void *thing) { + mobj_t *actor = thing; fixed_t dist; if (LUA_CallAction(A_JETGSHOOT, actor)) @@ -3810,8 +3870,9 @@ void A_JetgShoot(mobj_t *actor) // var1 = unused // var2 = unused // -void A_ShootBullet(mobj_t *actor) +void A_ShootBullet(void *thing) { + mobj_t *actor = thing; fixed_t dist; if (LUA_CallAction(A_SHOOTBULLET, actor)) @@ -3839,8 +3900,9 @@ void A_ShootBullet(mobj_t *actor) // var1 = unused // var2 = unused // -void A_MinusDigging(mobj_t *actor) +void A_MinusDigging(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_MINUSDIGGING, actor)) return; @@ -3890,9 +3952,9 @@ void A_MinusDigging(mobj_t *actor) // var1 = unused // var2 = unused // -void A_MinusPopup(mobj_t *actor) +void A_MinusPopup(void *thing) { - + mobj_t *actor = thing; if (LUA_CallAction(A_MINUSPOPUP, actor)) return; @@ -3912,8 +3974,9 @@ void A_MinusPopup(mobj_t *actor) // var1 = unused // var2 = unused // -void A_MinusCheck(mobj_t *actor) +void A_MinusCheck(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_MINUSCHECK, actor)) return; @@ -3939,8 +4002,9 @@ void A_MinusCheck(mobj_t *actor) // var1 = unused // var2 = unused // -void A_ChickenCheck(mobj_t *actor) +void A_ChickenCheck(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_CHICKENCHECK, actor)) return; @@ -3966,8 +4030,9 @@ void A_ChickenCheck(mobj_t *actor) // var1 = unused // var2 = unused // -void A_JetgThink(mobj_t *actor) +void A_JetgThink(void *thing) { + mobj_t *actor = thing; sector_t *nextsector; fixed_t thefloor; @@ -4020,8 +4085,9 @@ void A_JetgThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_MouseThink(mobj_t *actor) +void A_MouseThink(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_MOUSETHINK, actor)) return; @@ -4049,8 +4115,9 @@ void A_MouseThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_DetonChase(mobj_t *actor) +void A_DetonChase(void *thing) { + mobj_t *actor = thing; angle_t exact; fixed_t xydist, dist; @@ -4198,8 +4265,9 @@ void A_DetonChase(mobj_t *actor) // upper 16 bits = forward/backward offset // lower 16 bits = sideways offset // -void A_CapeChase(mobj_t *actor) +void A_CapeChase(void *thing) { + mobj_t *actor = thing; mobj_t *chaser; fixed_t foffsetx, foffsety, boffsetx, boffsety; INT32 locvar1 = var1; @@ -4261,8 +4329,9 @@ void A_CapeChase(mobj_t *actor) // 1 = Use tracer // var2 = unused // -void A_RotateSpikeBall(mobj_t *actor) +void A_RotateSpikeBall(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; const fixed_t radius = FixedMul(12*actor->info->speed, actor->scale); @@ -4312,8 +4381,9 @@ void A_RotateSpikeBall(mobj_t *actor) // 2 = Throw when target leaves MF2_SKULLFLY. // var2 = unused // -void A_UnidusBall(mobj_t *actor) +void A_UnidusBall(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; boolean canthrow = false; @@ -4405,8 +4475,9 @@ void A_UnidusBall(mobj_t *actor) // // var1 = unused // var2 = unused -void A_RockSpawn(mobj_t *actor) +void A_RockSpawn(void *thing) { + mobj_t *actor = thing; mobj_t *mo; mobjtype_t type; fixed_t dist; @@ -4449,8 +4520,9 @@ void A_RockSpawn(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SlingAppear(mobj_t *actor) +void A_SlingAppear(void *thing) { + mobj_t *actor = thing; UINT8 mlength = 4; mobj_t *spawnee, *hprev; @@ -4499,8 +4571,9 @@ void A_SlingAppear(mobj_t *actor) // lower 16 bits = if > 0, state to change to when fuse = 1 // upper 16 bits: 0 = (default) don't set fuse unless 0, 1 = force change, 2 = force no change // -void A_SetFuse(mobj_t *actor) +void A_SetFuse(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -4524,8 +4597,9 @@ void A_SetFuse(mobj_t *actor) // var1 = shoot bullets? // var2 = "pogo mode" speed // -void A_CrawlaCommanderThink(mobj_t *actor) +void A_CrawlaCommanderThink(void *thing) { + mobj_t *actor = thing; fixed_t dist; sector_t *nextsector; fixed_t thefloor; @@ -4674,8 +4748,9 @@ void A_CrawlaCommanderThink(mobj_t *actor) // var1 = unused // var2 = unused // -void A_RingExplode(mobj_t *actor) +void A_RingExplode(void *thing) { + mobj_t *actor = thing; mobj_t *mo2; thinker_t *th; angle_t d; @@ -4690,7 +4765,7 @@ void A_RingExplode(mobj_t *actor) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -4718,7 +4793,9 @@ void A_RingExplode(mobj_t *actor) // var1 = object # to explode as debris // var2 = unused // -void A_OldRingExplode(mobj_t *actor) { +void A_OldRingExplode(void *thing) +{ + mobj_t *actor = thing; UINT8 i; mobj_t *mo; const fixed_t ns = FixedMul(20 * FRACUNIT, actor->scale); @@ -4796,8 +4873,9 @@ void A_OldRingExplode(mobj_t *actor) { // var1 = unused // var2 = unused // -void A_MixUp(mobj_t *actor) +void A_MixUp(void *thing) { + mobj_t *actor = thing; boolean teleported[MAXPLAYERS]; INT32 i, numplayers = 0, prandom = 0; @@ -5042,8 +5120,9 @@ void A_MixUp(mobj_t *actor) // var1 = unused // var2 = unused // -void A_Boss1Chase(mobj_t *actor) +void A_Boss1Chase(void *thing) { + mobj_t *actor = thing; INT32 delta; if (LUA_CallAction(A_BOSS1CHASE, actor)) @@ -5160,8 +5239,9 @@ nomissile: // var1 = unused // var2 = unused // -void A_Boss2Chase(mobj_t *actor) +void A_Boss2Chase(void *thing) { + mobj_t *actor = thing; fixed_t radius; boolean reverse = false; INT32 speedvar; @@ -5290,8 +5370,9 @@ void A_Boss2Chase(mobj_t *actor) // var1 = unused // var2 = unused // -void A_Boss2Pogo(mobj_t *actor) +void A_Boss2Pogo(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_BOSS2POGO, actor)) return; @@ -5336,8 +5417,9 @@ void A_Boss2Pogo(mobj_t *actor) // var1 = Invincibility duration // var2 = unused // -void A_Boss2TakeDamage(mobj_t *actor) +void A_Boss2TakeDamage(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_BOSS2TAKEDAMAGE, actor)) @@ -5358,8 +5440,9 @@ void A_Boss2TakeDamage(mobj_t *actor) // var1 = unused // var2 = unused // -void A_Boss7Chase(mobj_t *actor) +void A_Boss7Chase(void *thing) { + mobj_t *actor = thing; INT32 delta; INT32 i; @@ -5480,8 +5563,9 @@ void A_Boss7Chase(mobj_t *actor) // var1 = unused // var2 = unused // -void A_GoopSplat(mobj_t *actor) +void A_GoopSplat(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_GOOPSPLAT, actor)) return; @@ -5502,8 +5586,9 @@ void A_GoopSplat(mobj_t *actor) // var1 = pogo jump strength // var2 = idle pogo speed // -void A_Boss2PogoSFX(mobj_t *actor) +void A_Boss2PogoSFX(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -5544,8 +5629,9 @@ void A_Boss2PogoSFX(mobj_t *actor) // var1 = pogo jump strength // var2 = idle pogo speed // -void A_Boss2PogoTarget(mobj_t *actor) +void A_Boss2PogoTarget(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -5632,8 +5718,9 @@ void A_Boss2PogoTarget(mobj_t *actor) // var1 = unused // var2 = unused // -void A_EggmanBox(mobj_t *actor) +void A_EggmanBox(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_EGGMANBOX, actor)) return; @@ -5653,8 +5740,9 @@ void A_EggmanBox(mobj_t *actor) // var1 = object # to repeatedly fire // var2 = distance threshold // -void A_TurretFire(mobj_t *actor) +void A_TurretFire(void *thing) { + mobj_t *actor = thing; INT32 count = 0; fixed_t dist; INT32 locvar1 = var1; @@ -5691,8 +5779,9 @@ void A_TurretFire(mobj_t *actor) // var1 = object # to repeatedly fire // var2 = distance threshold // -void A_SuperTurretFire(mobj_t *actor) +void A_SuperTurretFire(void *thing) { + mobj_t *actor = thing; INT32 count = 0; fixed_t dist; INT32 locvar1 = var1; @@ -5730,8 +5819,9 @@ void A_SuperTurretFire(mobj_t *actor) // var1 = Don't play activesound? // var2 = unused // -void A_TurretStop(mobj_t *actor) +void A_TurretStop(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_TURRETSTOP, actor)) @@ -5751,8 +5841,9 @@ void A_TurretStop(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SparkFollow(mobj_t *actor) +void A_SparkFollow(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SPARKFOLLOW, actor)) return; @@ -5783,8 +5874,9 @@ void A_SparkFollow(mobj_t *actor) // var1 = sfx to play // var2 = length of sfx, set to threshold if played // -void A_BuzzFly(mobj_t *actor) +void A_BuzzFly(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -5883,8 +5975,9 @@ void A_BuzzFly(mobj_t *actor) // var1 = unused // var2 = unused // -void A_GuardChase(mobj_t *actor) +void A_GuardChase(void *thing) { + mobj_t *actor = thing; INT32 delta; if (LUA_CallAction(A_GUARDCHASE, actor)) @@ -5939,10 +6032,10 @@ void A_GuardChase(mobj_t *actor) // Now that we've moved, its time for our shield to move! // Otherwise it'll never act as a proper overlay. if (actor->tracer && actor->tracer->state - && actor->tracer->state->action.acp1) + && actor->tracer->state->action) { var1 = actor->tracer->state->var1, var2 = actor->tracer->state->var2; - actor->tracer->state->action.acp1(actor->tracer); + actor->tracer->state->action(actor->tracer); } } @@ -5953,8 +6046,9 @@ void A_GuardChase(mobj_t *actor) // var1 = unused // var2 = unused // -void A_EggShield(mobj_t *actor) +void A_EggShield(void *thing) { + mobj_t *actor = thing; INT32 i; player_t *player; fixed_t blockdist; @@ -6042,8 +6136,9 @@ void A_EggShield(mobj_t *actor) // var1 = 1 (use value in var2); 0 (use info table value) // var2 = if var1 = 1, then value to set // -void A_SetReactionTime(mobj_t *actor) +void A_SetReactionTime(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_SETREACTIONTIME, actor)) return; @@ -6060,8 +6155,9 @@ void A_SetReactionTime(mobj_t *actor) // var1 = ball number // var2 = total balls // -void A_Boss1Spikeballs(mobj_t *actor) +void A_Boss1Spikeballs(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *ball; @@ -6076,7 +6172,7 @@ void A_Boss1Spikeballs(mobj_t *actor) S_StartSound(ball, ball->info->seesound); var1 = ball->state->var1, var2 = ball->state->var2; - ball->state->action.acp1(ball); + ball->state->action(ball); } // Function: A_Boss3TakeDamage @@ -6086,8 +6182,9 @@ void A_Boss1Spikeballs(mobj_t *actor) // var1 = movecount value // var2 = unused // -void A_Boss3TakeDamage(mobj_t *actor) +void A_Boss3TakeDamage(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_BOSS3TAKEDAMAGE, actor)) return; @@ -6104,8 +6201,9 @@ void A_Boss3TakeDamage(mobj_t *actor) // var1 = unused // var2 = unused // -void A_Boss3Path(mobj_t *actor) +void A_Boss3Path(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_BOSS3PATH, actor)) return; @@ -6142,7 +6240,7 @@ void A_Boss3Path(mobj_t *actor) // the number for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -6227,8 +6325,9 @@ void A_Boss3Path(mobj_t *actor) // var1 = tag // var2 = add angle to tag (optional) // -void A_LinedefExecute(mobj_t *actor) +void A_LinedefExecute(void *thing) { + mobj_t *actor = thing; INT32 tagnum; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6255,8 +6354,9 @@ void A_LinedefExecute(mobj_t *actor) // var1 = mapthing arg to take tag from // var2 = unused // -void A_LinedefExecuteFromArg(mobj_t *actor) +void A_LinedefExecuteFromArg(void *thing) { + mobj_t *actor = thing; INT32 tagnum; INT32 locvar1 = var1; @@ -6284,8 +6384,9 @@ void A_LinedefExecuteFromArg(mobj_t *actor) // var1 = unused // var2 = unused // -void A_PlaySeeSound(mobj_t *actor) +void A_PlaySeeSound(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_PLAYSEESOUND, actor)) return; @@ -6300,8 +6401,9 @@ void A_PlaySeeSound(mobj_t *actor) // var1 = unused // var2 = unused // -void A_PlayAttackSound(mobj_t *actor) +void A_PlayAttackSound(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_PLAYATTACKSOUND, actor)) return; @@ -6316,8 +6418,9 @@ void A_PlayAttackSound(mobj_t *actor) // var1 = unused // var2 = unused // -void A_PlayActiveSound(mobj_t *actor) +void A_PlayActiveSound(void *thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_PLAYACTIVESOUND, actor)) return; @@ -6332,8 +6435,9 @@ void A_PlayActiveSound(mobj_t *actor) // var1 = object # to spawn as smoke // var2 = unused // -void A_SmokeTrailer(mobj_t *actor) +void A_SmokeTrailer(void *thing) { + mobj_t *actor = thing; mobj_t *th; INT32 locvar1 = var1; @@ -6370,8 +6474,9 @@ void A_SmokeTrailer(mobj_t *actor) // var2 >> 16 = z // var2 & 65535 = type // -void A_SpawnObjectAbsolute(mobj_t *actor) +void A_SpawnObjectAbsolute(void *thing) { + mobj_t *actor = thing; INT16 x, y, z; // Want to be sure we can use negative values mobjtype_t type; mobj_t *mo; @@ -6406,8 +6511,9 @@ void A_SpawnObjectAbsolute(mobj_t *actor) // var2 >> 16 = z // var2 & 65535 = type // -void A_SpawnObjectRelative(mobj_t *actor) +void A_SpawnObjectRelative(void *thing) { + mobj_t *actor = thing; INT16 x, y, z; // Want to be sure we can use negative values mobjtype_t type; mobj_t *mo; @@ -6445,8 +6551,9 @@ void A_SpawnObjectRelative(mobj_t *actor) // var1 = min // var2 = max // -void A_ChangeAngleRelative(mobj_t *actor) +void A_ChangeAngleRelative(void *thing) { + mobj_t *actor = thing; // Oh god, the old code /sucked/. Changed this and the absolute version to get a random range using amin and amax instead of // getting a random angle from the _entire_ spectrum and then clipping. While we're at it, do the angle conversion to the result // rather than the ranges, so <0 and >360 work as possible values. -Red @@ -6481,8 +6588,9 @@ void A_ChangeAngleRelative(mobj_t *actor) // var1 = min // var2 = max // -void A_ChangeAngleAbsolute(mobj_t *actor) +void A_ChangeAngleAbsolute(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; //angle_t angle = (P_RandomByte()+1)<<24; @@ -6514,8 +6622,9 @@ void A_ChangeAngleAbsolute(mobj_t *actor) // var1 = angle // var2 = relative? (default) // -void A_RollAngle(mobj_t *actor) +void A_RollAngle(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; const angle_t angle = FixedAngle(locvar1*FRACUNIT); @@ -6538,8 +6647,9 @@ void A_RollAngle(mobj_t *actor) // var1 = min // var2 = max // -void A_ChangeRollAngleRelative(mobj_t *actor) +void A_ChangeRollAngleRelative(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; const fixed_t amin = locvar1*FRACUNIT; @@ -6563,8 +6673,9 @@ void A_ChangeRollAngleRelative(mobj_t *actor) // var1 = min // var2 = max // -void A_ChangeRollAngleAbsolute(mobj_t *actor) +void A_ChangeRollAngleAbsolute(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; const fixed_t amin = locvar1*FRACUNIT; @@ -6590,8 +6701,9 @@ void A_ChangeRollAngleAbsolute(mobj_t *actor) // lower 16 bits = If 1, play sound using calling object as origin. If 0, play sound without an origin // upper 16 bits = If 1, do not play sound during preticker. // -void A_PlaySound(mobj_t *actor) +void A_PlaySound(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6611,8 +6723,9 @@ void A_PlaySound(mobj_t *actor) // var1 = mobj type // var2 = if (0) nearest; else furthest; // -void A_FindTarget(mobj_t *actor) +void A_FindTarget(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *targetedmobj = NULL; @@ -6628,7 +6741,7 @@ void A_FindTarget(mobj_t *actor) // scan the thinkers for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -6675,8 +6788,9 @@ void A_FindTarget(mobj_t *actor) // var1 = mobj type // var2 = if (0) nearest; else furthest; // -void A_FindTracer(mobj_t *actor) +void A_FindTracer(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *targetedmobj = NULL; @@ -6692,7 +6806,7 @@ void A_FindTracer(mobj_t *actor) // scan the thinkers for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -6739,8 +6853,9 @@ void A_FindTracer(mobj_t *actor) // var1 = tics to set to // var2 = if this is set, and no var1 is supplied, the mobj's threshold value will be used. // -void A_SetTics(mobj_t *actor) +void A_SetTics(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6760,8 +6875,9 @@ void A_SetTics(mobj_t *actor) // var1 = lower bound // var2 = upper bound // -void A_SetRandomTics(mobj_t *actor) +void A_SetRandomTics(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6778,8 +6894,9 @@ void A_SetRandomTics(mobj_t *actor) // var1 = if (var1 > 0), find target and add its color value to yours // var2 = if (var1 = 0), color value to add // -void A_ChangeColorRelative(mobj_t *actor) +void A_ChangeColorRelative(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6803,8 +6920,9 @@ void A_ChangeColorRelative(mobj_t *actor) // var1 = if (var1 > 0), set your color to your target's color // var2 = if (var1 = 0), color value to set to // -void A_ChangeColorAbsolute(mobj_t *actor) +void A_ChangeColorAbsolute(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6827,8 +6945,9 @@ void A_ChangeColorAbsolute(mobj_t *actor) // var1 = if (var1 != 0), dye your target instead of yourself // var2 = color value to dye // -void A_Dye(mobj_t *actor) +void A_Dye(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6862,8 +6981,9 @@ void A_Dye(mobj_t *actor) // var1 = angle // var2 = force // -void A_MoveRelative(mobj_t *actor) +void A_MoveRelative(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6880,8 +7000,9 @@ void A_MoveRelative(mobj_t *actor) // var1 = angle // var2 = force // -void A_MoveAbsolute(mobj_t *actor) +void A_MoveAbsolute(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6898,8 +7019,9 @@ void A_MoveAbsolute(mobj_t *actor) // var1 = amount of force // var2 = If 1, xy momentum is lost. If 0, xy momentum is kept // -void A_Thrust(mobj_t *actor) +void A_Thrust(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6924,8 +7046,9 @@ void A_Thrust(mobj_t *actor) // lower 16 bits = If 1, xy momentum is lost. If 0, xy momentum is kept // upper 16 bits = If 1, z momentum is lost. If 0, z momentum is kept // -void A_ZThrust(mobj_t *actor) +void A_ZThrust(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -6957,8 +7080,9 @@ void A_ZThrust(mobj_t *actor) // 0 = target/tracer's target // 1 = target/tracer's tracer // -void A_SetTargetsTarget(mobj_t *actor) +void A_SetTargetsTarget(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *oldtarg = NULL, *newtarg = NULL; @@ -7001,8 +7125,9 @@ void A_SetTargetsTarget(mobj_t *actor) // else if var2 == 1, remove the flag from the current flags // else if var2 == 0, set the flags to the exact value // -void A_SetObjectFlags(mobj_t *actor) +void A_SetObjectFlags(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; boolean unlinkthings = false; @@ -7043,8 +7168,9 @@ void A_SetObjectFlags(mobj_t *actor) // else if var2 == 1, remove the flag from the current flags // else if var2 == 0, set the flags to the exact value // -void A_SetObjectFlags2(mobj_t *actor) +void A_SetObjectFlags2(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7070,8 +7196,9 @@ void A_SetObjectFlags2(mobj_t *actor) // 3 - Boss 4 jet flame // var2 = unused // -void A_BossJetFume(mobj_t *actor) +void A_BossJetFume(void *thing) { + mobj_t *actor = thing; mobj_t *filler; INT32 locvar1 = var1; @@ -7180,8 +7307,9 @@ void A_BossJetFume(mobj_t *actor) // var1 = state number 1 // var2 = state number 2 // -void A_RandomState(mobj_t *actor) +void A_RandomState(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7198,8 +7326,9 @@ void A_RandomState(mobj_t *actor) // var1 = Minimum state number to choose. // var2 = Maximum state number to use. // -void A_RandomStateRange(mobj_t *actor) +void A_RandomStateRange(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7216,8 +7345,9 @@ void A_RandomStateRange(mobj_t *actor) // var1 = Minimum state number to use. // var2 = Maximum state number to use. The difference will act as a modulo operator. // -void A_StateRangeByAngle(mobj_t *actor) +void A_StateRangeByAngle(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7237,8 +7367,9 @@ void A_StateRangeByAngle(mobj_t *actor) // var1 = Minimum state number to use. // var2 = Maximum state number to use. The difference will act as a modulo operator. // -void A_StateRangeByParameter(mobj_t *actor) +void A_StateRangeByParameter(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; UINT8 parameter = 0; @@ -7278,8 +7409,9 @@ void A_StateRangeByParameter(mobj_t *actor) // var1 = state # to use 1st action from // var2 = state # to use 2nd action from // -void A_DualAction(mobj_t *actor) +void A_DualAction(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7293,14 +7425,14 @@ void A_DualAction(mobj_t *actor) astate = &states[locvar1]; CONS_Debug(DBG_GAMELOGIC, "A_DualAction: Calling First Action (state %d)...\n", locvar1); - states[locvar1].action.acp1(actor); + states[locvar1].action(actor); var1 = states[locvar2].var1; var2 = states[locvar2].var2; astate = &states[locvar2]; CONS_Debug(DBG_GAMELOGIC, "A_DualAction: Calling Second Action (state %d)...\n", locvar2); - states[locvar2].action.acp1(actor); + states[locvar2].action(actor); } // Function: A_RemoteAction @@ -7310,8 +7442,9 @@ void A_DualAction(mobj_t *actor) // var1 = remote object (-2 uses tracer, -1 uses target) // var2 = state reference for calling an action // -void A_RemoteAction(mobj_t *actor) +void A_RemoteAction(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *originaltarget = actor->target; // Hold on to the target for later. @@ -7331,7 +7464,7 @@ void A_RemoteAction(mobj_t *actor) // scan the thinkers for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -7383,7 +7516,7 @@ void A_RemoteAction(mobj_t *actor) CONS_Debug(DBG_GAMELOGIC, "A_RemoteAction: Calling action on %p\n" "var1 is %d\nvar2 is %d\n", (void*)actor->target, var1, var2); - states[locvar2].action.acp1(actor->target); + states[locvar2].action(actor->target); } P_SetTarget(&actor->target, originaltarget); // Restore the original target. @@ -7396,8 +7529,9 @@ void A_RemoteAction(mobj_t *actor) // var1 = unused // var2 = unused // -void A_ToggleFlameJet(mobj_t* actor) +void A_ToggleFlameJet(void* thing) { + mobj_t *actor = thing; if (LUA_CallAction(A_TOGGLEFLAMEJET, actor)) return; @@ -7438,8 +7572,9 @@ void A_ToggleFlameJet(mobj_t* actor) // Bits 1-10: X factor // Bits 11-20: Y factor // Bits 21-30: Z factor -void A_OrbitNights(mobj_t* actor) +void A_OrbitNights(void* thing) { + mobj_t *actor = thing; INT32 ofs = (var2 & 0x3FF); boolean ishelper = (var2 & 0x10000); boolean donotrescale = (var2 & 0x40000); @@ -7502,8 +7637,9 @@ void A_OrbitNights(mobj_t* actor) // var1 = duration in tics // var2 = unused // -void A_GhostMe(mobj_t *actor) +void A_GhostMe(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; mobj_t *ghost; @@ -7524,8 +7660,9 @@ void A_GhostMe(mobj_t *actor) // 0 = target // 1 = tracer // -void A_SetObjectState(mobj_t *actor) +void A_SetObjectState(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *target; @@ -7563,8 +7700,9 @@ void A_SetObjectState(mobj_t *actor) // lower 16 bits = type // upper 16 bits = range (if == 0, across whole map) // -void A_SetObjectTypeState(mobj_t *actor) +void A_SetObjectTypeState(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; const UINT16 loc2lw = (UINT16)(locvar2 & 65535); @@ -7579,7 +7717,7 @@ void A_SetObjectTypeState(mobj_t *actor) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -7611,8 +7749,9 @@ void A_SetObjectTypeState(mobj_t *actor) // 1 = tracer // var2 = unused // -void A_KnockBack(mobj_t *actor) +void A_KnockBack(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; mobj_t *target; @@ -7644,8 +7783,9 @@ void A_KnockBack(mobj_t *actor) // lower 16 bits = If 1, xy momentum is lost. If 0, xy momentum is kept // upper 16 bits = 0 - target, 1 - tracer // -void A_PushAway(mobj_t *actor) +void A_PushAway(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *target; // target @@ -7680,8 +7820,9 @@ void A_PushAway(mobj_t *actor) // var1 = ammount of drained rings // var2 = unused // -void A_RingDrain(mobj_t *actor) +void A_RingDrain(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; player_t *player; @@ -7708,8 +7849,9 @@ void A_RingDrain(mobj_t *actor) // lower 16 bits = missile type // upper 16 bits = height offset // -void A_SplitShot(mobj_t *actor) +void A_SplitShot(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; const UINT16 loc2lw = (UINT16)(locvar2 & 65535); @@ -7749,8 +7891,9 @@ void A_SplitShot(mobj_t *actor) // var1 = splitting missile type // var2 = splitting angle // -void A_MissileSplit(mobj_t *actor) +void A_MissileSplit(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7772,8 +7915,9 @@ void A_MissileSplit(mobj_t *actor) // upper 16 bits = missile type # // var2 = height offset // -void A_MultiShot(mobj_t *actor) +void A_MultiShot(void *thing) { + mobj_t *actor = thing; fixed_t z, xr, yr; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7832,8 +7976,9 @@ void A_MultiShot(mobj_t *actor) // upper 16 bits = maximum step # // var2 = force // -void A_InstaLoop(mobj_t *actor) +void A_InstaLoop(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t force = max(locvar2, 1)*FRACUNIT; // defaults to 1 if var2 < 1 @@ -7861,8 +8006,9 @@ void A_InstaLoop(mobj_t *actor) // lower 16 bits = vertical rotation speed in 1/10 fracunits per tic // upper 16 bits = horizontal rotation speed in 1/10 fracunits per tic // -void A_Custom3DRotate(mobj_t *actor) +void A_Custom3DRotate(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7931,8 +8077,9 @@ void A_Custom3DRotate(mobj_t *actor) // else, do not call a specific state if no players are available // var2 = state number // -void A_SearchForPlayers(mobj_t *actor) +void A_SearchForPlayers(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -7962,8 +8109,9 @@ void A_SearchForPlayers(mobj_t *actor) // upper 16 bits = numerator (defaults to 1 if zero) // var2 = state number // -void A_CheckRandom(mobj_t *actor) +void A_CheckRandom(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t chance = FRACUNIT; @@ -7990,8 +8138,9 @@ void A_CheckRandom(mobj_t *actor) // var1 = if player rings >= var1 call state // var2 = state number // -void A_CheckTargetRings(mobj_t *actor) +void A_CheckTargetRings(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8012,8 +8161,9 @@ void A_CheckTargetRings(mobj_t *actor) // var1 = if player rings >= var1 call state // var2 = state number // -void A_CheckRings(mobj_t *actor) +void A_CheckRings(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; INT32 i, cntr = 0; @@ -8035,8 +8185,9 @@ void A_CheckRings(mobj_t *actor) // var1 = if total player rings >= var1 call state // var2 = state number // -void A_CheckTotalRings(mobj_t *actor) +void A_CheckTotalRings(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8059,8 +8210,9 @@ void A_CheckTotalRings(mobj_t *actor) // var1 = if health <= var1 call state // var2 = state number // -void A_CheckHealth(mobj_t *actor) +void A_CheckHealth(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8080,8 +8232,9 @@ void A_CheckHealth(mobj_t *actor) // upper 16 bits = 0 - target, 1 - tracer // var2 = state number // -void A_CheckRange(mobj_t *actor) +void A_CheckRange(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t dist; @@ -8110,8 +8263,9 @@ void A_CheckRange(mobj_t *actor) // upper 16 bits = 0 - target, 1 - tracer // var2 = state number // -void A_CheckHeight(mobj_t *actor) +void A_CheckHeight(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t height; @@ -8140,8 +8294,9 @@ void A_CheckHeight(mobj_t *actor) // upper 16 bits = 0 - target, 1 - tracer // var2 = state number // -void A_CheckTrueRange(mobj_t *actor) +void A_CheckTrueRange(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t height; // vertical range @@ -8184,8 +8339,9 @@ void A_CheckTrueRange(mobj_t *actor) // lower 16 bits = state to call // upper 16 bits = range (if == 0, check whole map) // -void A_CheckThingCount(mobj_t *actor) +void A_CheckThingCount(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8204,7 +8360,7 @@ void A_CheckThingCount(mobj_t *actor) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -8236,8 +8392,9 @@ void A_CheckThingCount(mobj_t *actor) // 1 = tracer // var2 = state number // -void A_CheckAmbush(mobj_t *actor) +void A_CheckAmbush(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; angle_t at; // angle target is currently facing @@ -8277,8 +8434,9 @@ void A_CheckAmbush(mobj_t *actor) // var1 = if custom value >= var1, call state // var2 = state number // -void A_CheckCustomValue(mobj_t *actor) +void A_CheckCustomValue(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8296,8 +8454,9 @@ void A_CheckCustomValue(mobj_t *actor) // var1 = if memory value >= var1, call state // var2 = state number // -void A_CheckCusValMemo(mobj_t *actor) +void A_CheckCusValMemo(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8321,8 +8480,9 @@ void A_CheckCusValMemo(mobj_t *actor) // else if var2 == 1, substract var1 from the custom value // else if var2 == 0, replace the custom value with var1 // -void A_SetCustomValue(mobj_t *actor) +void A_SetCustomValue(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8368,8 +8528,9 @@ void A_SetCustomValue(mobj_t *actor) // else if var2 == 1, mem -= cv || cv -= mem // else mem = cv || cv = mem // -void A_UseCusValMemo(mobj_t *actor) +void A_UseCusValMemo(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8431,8 +8592,9 @@ void A_UseCusValMemo(mobj_t *actor) // else if var2 == 1, substract var1 from the target's custom value // else if var2 == 0, replace the target's custom value with var1 // -void A_RelayCustomValue(mobj_t *actor) +void A_RelayCustomValue(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8493,8 +8655,9 @@ void A_RelayCustomValue(mobj_t *actor) // else if var2 == 1, only replace new action's var2 with custom value // else if var2 == 0, only replace new action's var1 with custom value // -void A_CusValAction(mobj_t *actor) +void A_CusValAction(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8533,7 +8696,7 @@ void A_CusValAction(mobj_t *actor) } astate = &states[locvar1]; - states[locvar1].action.acp1(actor); + states[locvar1].action(actor); } // Function: A_ForceStop @@ -8545,8 +8708,9 @@ void A_CusValAction(mobj_t *actor) // else, stop x-y-movement only // var2 = unused // -void A_ForceStop(mobj_t *actor) +void A_ForceStop(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_FORCESTOP, actor)) @@ -8564,8 +8728,9 @@ void A_ForceStop(mobj_t *actor) // var1 = unused // var2 = unused // -void A_ForceWin(mobj_t *actor) +void A_ForceWin(void *thing) { + mobj_t *actor = thing; INT32 i; if (LUA_CallAction(A_FORCEWIN, actor)) @@ -8593,8 +8758,9 @@ void A_ForceWin(mobj_t *actor) // else, actor solid // var2 = unused // -void A_SpikeRetract(mobj_t *actor) +void A_SpikeRetract(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_SPIKERETRACT, actor)) @@ -8631,8 +8797,9 @@ void A_SpikeRetract(mobj_t *actor) // else if var1 == 6, set actor to raisestate // var2 = unused // -void A_InfoState(mobj_t *actor) +void A_InfoState(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; switch (locvar1) { @@ -8676,8 +8843,9 @@ void A_InfoState(mobj_t *actor) // var1 = repeat count // var2 = state to return to if extravalue2 > 0 // -void A_Repeat(mobj_t *actor) +void A_Repeat(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -8700,8 +8868,9 @@ void A_Repeat(mobj_t *actor) // upper 16 bits: 0 = actor, 1 = target, 2 = tracer // lower 16 bits: 0 = instant change, 1 = smooth change // -void A_SetScale(mobj_t *actor) +void A_SetScale(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *target; @@ -8744,8 +8913,9 @@ void A_SetScale(mobj_t *actor) // var1 = Mobj affected: 0 - actor, 1 - target, 2 - tracer // var2 = Action: 0 - Damage, 1 - Kill, 2 - Remove // -void A_RemoteDamage(mobj_t *actor) +void A_RemoteDamage(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *target; // we MUST have a target @@ -8797,8 +8967,9 @@ void A_RemoteDamage(mobj_t *actor) // var1 = speed multiple // var2 = destination: 0 = target, 1 = tracer // -void A_HomingChase(mobj_t *actor) +void A_HomingChase(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *dest; @@ -8846,8 +9017,9 @@ void A_HomingChase(mobj_t *actor) // use vertical angle variable as horizontal distance to cover during momz calculation // upper 16 bits = height offset // -void A_TrapShot(mobj_t *actor) +void A_TrapShot(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; boolean oldstyle = (locvar2 & 32768) ? true : false; @@ -8915,8 +9087,9 @@ void A_TrapShot(mobj_t *actor) // var1 = mobj to spawn // var2 = If 0, target only the actor's target. Else, target every player, period. // -void A_VileTarget(mobj_t *actor) +void A_VileTarget(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *fog; @@ -9001,8 +9174,9 @@ void A_VileTarget(mobj_t *actor) // Lower 16 bits = optional explosion object // Upper 16 bits = If 0, attack only the actor's target. Else, attack all the players. All of them. // -void A_VileAttack(mobj_t *actor) +void A_VileAttack(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; sfxenum_t soundtoplay; @@ -9116,8 +9290,9 @@ void A_VileAttack(mobj_t *actor) // Lower 16 bits = mobj to spawn (0 doesn't spawn a line at all) // Upper 16 bits = # to spawn (default is 8) // -void A_VileFire(mobj_t *actor) +void A_VileFire(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; mobj_t *dest; @@ -9200,8 +9375,9 @@ void A_VileFire(mobj_t *actor) // var1 = lower-bound of frame length, in tics // var2 = optional sound to play // -void A_BrakChase(mobj_t *actor) +void A_BrakChase(void *thing) { + mobj_t *actor = thing; INT32 delta; INT32 lowerbound; INT32 newtics; @@ -9323,8 +9499,9 @@ void A_BrakChase(mobj_t *actor) // var1 = object # to shoot // var2 = unused // -void A_BrakFireShot(mobj_t *actor) +void A_BrakFireShot(void *thing) { + mobj_t *actor = thing; fixed_t x, y, z; INT32 locvar1 = var1; @@ -9371,8 +9548,9 @@ void A_BrakFireShot(mobj_t *actor) // Upper 16 bits: if 0, aim 1/3 of the way. Else, aim directly at target. // -void A_BrakLobShot(mobj_t *actor) +void A_BrakLobShot(void *thing) { + mobj_t *actor = thing; fixed_t v; // Velocity to shoot object fixed_t a1, a2, aToUse; // Velocity squared fixed_t g; // Gravity @@ -9482,8 +9660,9 @@ void A_BrakLobShot(mobj_t *actor) // Lower 16 bits: distance to toss them (No default - 0 does just that - but negatives will revert to 128) // Upper 16 bits: airtime in tics (default 16) // -void A_NapalmScatter(mobj_t *actor) +void A_NapalmScatter(void *thing) { + mobj_t *actor = thing; mobjtype_t typeOfShot = var1 & 0x0000FFFF; // Type INT32 numToShoot = (var1 & 0xFFFF0000) >> 16; // How many fixed_t distance = (var2 & 0x0000FFFF) << FRACBITS; // How far @@ -9539,8 +9718,9 @@ void A_NapalmScatter(mobj_t *actor) // var1 = unused // var2 = unused // -void A_SpawnFreshCopy(mobj_t *actor) +void A_SpawnFreshCopy(void *thing) { + mobj_t *actor = thing; mobj_t *newObject; if (LUA_CallAction(A_SPAWNFRESHCOPY, actor)) @@ -9614,8 +9794,9 @@ mobj_t *P_InternalFlickySpawn(mobj_t *actor, mobjtype_t flickytype, fixed_t momz // bit 19: if 1, spawn flicky slightly backward from spawn position. doesn't stack with 18. // var2 = upwards thrust for spawned flicky. If zero, default value is provided. // -void A_FlickySpawn(mobj_t *actor) +void A_FlickySpawn(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1 & 65535; INT32 locvar2 = var2; INT32 test = (var1 >> 16); @@ -9677,8 +9858,9 @@ void P_InternalFlickySetColor(mobj_t *actor, UINT8 color) // If TMFF_STATIONARY (MF_GRENADEBOUNCE): Flickies stand in-place without gravity (unless they hop, then gravity is applied.) // If TMFF_HOP (MF_NOCLIPTHING): is flagged, Flickies hop. // -void A_FlickyCenter(mobj_t *actor) +void A_FlickyCenter(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t homeRadius = INT32_MAX; @@ -9755,6 +9937,7 @@ void A_FlickyCenter(mobj_t *actor) // Internal Flicky bubbling function. void P_InternalFlickyBubble(mobj_t *actor) { + if (actor->eflags & MFE_UNDERWATER) { mobj_t *overlay; @@ -9783,8 +9966,9 @@ void P_InternalFlickyBubble(mobj_t *actor) // var1 = how far around the target (in angle constants) the flicky should look // var2 = distance from target to aim for // -void A_FlickyAim(mobj_t *actor) +void A_FlickyAim(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; boolean flickyhitwall = false; @@ -9884,8 +10068,9 @@ void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fi // var1 = how fast to fly // var2 = how far ahead the target should be considered // -void A_FlickyFly(mobj_t *actor) +void A_FlickyFly(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -9904,8 +10089,9 @@ void A_FlickyFly(mobj_t *actor) // var1 = how fast to fly // var2 = how far ahead the target should be considered // -void A_FlickySoar(mobj_t *actor) +void A_FlickySoar(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -9928,8 +10114,9 @@ void A_FlickySoar(mobj_t *actor) // var2 = state to change to upon slowing down // the spawnstate of the mobj = state to change to when above water // -void A_FlickyCoast(mobj_t *actor) +void A_FlickyCoast(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -9975,8 +10162,9 @@ void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angl // var1 = vertical thrust // var2 = horizontal thrust // -void A_FlickyHop(mobj_t *actor) +void A_FlickyHop(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -9993,8 +10181,9 @@ void A_FlickyHop(mobj_t *actor) // var1 = intended vertical thrust // var2 = intended horizontal thrust // -void A_FlickyFlounder(mobj_t *actor) +void A_FlickyFlounder(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; angle_t hopangle; @@ -10016,8 +10205,9 @@ void A_FlickyFlounder(mobj_t *actor) // var2 = state to change to upon falling // the meleestate of the mobj = state to change to when underwater // -void A_FlickyCheck(mobj_t *actor) +void A_FlickyCheck(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -10053,8 +10243,9 @@ void A_FlickyCheck(mobj_t *actor) // var1 = state to change to when falling below height relative to target // var2 = height relative to target to change state at // -void A_FlickyHeightCheck(mobj_t *actor) +void A_FlickyHeightCheck(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -10088,8 +10279,9 @@ void A_FlickyHeightCheck(mobj_t *actor) // var2 = state to change to upon falling // the meleestate of the mobj = state to change to when underwater // -void A_FlickyFlutter(mobj_t *actor) +void A_FlickyFlutter(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -10118,8 +10310,9 @@ void A_FlickyFlutter(mobj_t *actor) // var1 = unused // var2 = unused // -void A_FlameParticle(mobj_t *actor) +void A_FlameParticle(void *thing) { + mobj_t *actor = thing; mobjtype_t type = (mobjtype_t)(mobjinfo[actor->type].painchance); fixed_t rad, hei; mobj_t *particle; @@ -10152,8 +10345,9 @@ void A_FlameParticle(mobj_t *actor) // var1 = bit 1 = bit 1 = don't make fast, bit 2 = don't set tracer // var2 = unused // -void A_FadeOverlay(mobj_t *actor) +void A_FadeOverlay(void *thing) { + mobj_t *actor = thing; mobj_t *fade; INT32 locvar1 = var1; @@ -10181,8 +10375,9 @@ void A_FadeOverlay(mobj_t *actor) // var1 = Object type to connect to ground // var2 = Object type to place on ground // -void A_ConnectToGround(mobj_t *actor) +void A_ConnectToGround(void *thing) { + mobj_t *actor = thing; mobj_t *work; fixed_t workz; fixed_t workh; @@ -10241,8 +10436,9 @@ void A_ConnectToGround(mobj_t *actor) // var2 >> 16 = z // var2 & 65535 = state // -void A_SpawnParticleRelative(mobj_t *actor) +void A_SpawnParticleRelative(void *thing) { + mobj_t *actor = thing; INT16 x, y, z; // Want to be sure we can use negative values statenum_t state; mobj_t *mo; @@ -10274,8 +10470,9 @@ void A_SpawnParticleRelative(mobj_t *actor) P_SetMobjState(mo, state); } -void A_ParticleSpawn(mobj_t *actor) +void A_ParticleSpawn(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; fixed_t speed; mobjtype_t type; @@ -10315,8 +10512,9 @@ void A_ParticleSpawn(mobj_t *actor) // var1 = same as A_MultiShot // var2 = same as A_MultiShot // -void A_MultiShotDist(mobj_t *actor) +void A_MultiShotDist(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -10347,8 +10545,9 @@ void A_MultiShotDist(mobj_t *actor) // var1 = mask // var2 = state to go // -void A_CheckFlags2(mobj_t *actor) +void A_CheckFlags2(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -10366,8 +10565,9 @@ void A_CheckFlags2(mobj_t *actor) // var1 = state to change to upon being slow enough // var2 = minimum speed // -void A_DoNPCSkid(mobj_t *actor) +void A_DoNPCSkid(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t x, y, z; @@ -10421,8 +10621,9 @@ void A_DoNPCSkid(mobj_t *actor) // Otherwise, vertical and horizontal speed // will be multiplied by this. // -void A_DoNPCPain(mobj_t *actor) +void A_DoNPCPain(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t vspeed = 0; @@ -10472,8 +10673,9 @@ void A_DoNPCPain(mobj_t *actor) // var1 = value to set extravalue2 to // var2 = unused // -void A_PrepareRepeat(mobj_t *actor) +void A_PrepareRepeat(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_PREPAREREPEAT, actor)) @@ -10490,8 +10692,9 @@ void A_PrepareRepeat(mobj_t *actor) // var1 upper 16 bits = distance limit // var2 = unused // -void A_LookForBetter(mobj_t *actor) +void A_LookForBetter(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; if (LUA_CallAction(A_LOOKFORBETTER, actor)) @@ -10508,8 +10711,9 @@ void A_LookForBetter(mobj_t *actor) // var1 = Modulo // var2 = State // -void A_ModuloToState(mobj_t *actor) +void A_ModuloToState(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; @@ -10530,8 +10734,9 @@ void A_ModuloToState(mobj_t *actor) // &1: height is absolute // &2: scale with actor's scale // -void A_ChangeHeight(mobj_t *actor) +void A_ChangeHeight(void *thing) { + mobj_t *actor = thing; INT32 locvar1 = var1; INT32 locvar2 = var2; fixed_t height = locvar1; @@ -10565,9 +10770,9 @@ void A_ChangeHeight(mobj_t *actor) // SRB2Kart // -void A_ItemPop(mobj_t *actor) +void A_ItemPop(void *thing) { - + mobj_t *actor = thing; mobj_t *remains; mobjtype_t explode; @@ -10652,8 +10857,9 @@ void A_ItemPop(mobj_t *actor) P_RemoveMobj(actor); } -void A_JawzChase(mobj_t *actor) +void A_JawzChase(void *thing) { + mobj_t *actor = thing; player_t *player; if (LUA_CallAction(A_JAWZCHASE, actor)) @@ -10694,8 +10900,9 @@ void A_JawzChase(mobj_t *actor) return; } -void A_JawzExplode(mobj_t *actor) +void A_JawzExplode(void *thing) { + mobj_t *actor = thing; INT32 shrapnel = 2; mobj_t *truc; @@ -10737,8 +10944,9 @@ void A_JawzExplode(mobj_t *actor) return; } -void A_SPBChase(mobj_t *actor) +void A_SPBChase(void *thing) { + mobj_t *actor = thing; player_t *player = NULL; UINT8 i; UINT8 bestrank = UINT8_MAX; @@ -11107,8 +11315,9 @@ static inline BlockItReturn_t PIT_SSMineSearch(mobj_t *thing) return BMIT_ABORT; } -void A_SSMineSearch(mobj_t *actor) +void A_SSMineSearch(void *thing) { + mobj_t *actor = thing; INT32 bx, by, xl, xh, yl, yh; explodedist = FixedMul(actor->info->painchance, mapobjectscale); @@ -11171,8 +11380,9 @@ static inline BlockItReturn_t PIT_MineExplode(mobj_t *thing) return BMIT_CONTINUE; } -void A_SSMineExplode(mobj_t *actor) +void A_SSMineExplode(void *thing) { + mobj_t *actor = thing; INT32 bx, by, xl, xh, yl, yh; INT32 d; INT32 locvar1 = var1; @@ -11215,9 +11425,9 @@ void A_SSMineExplode(mobj_t *actor) actor->flags2 |= MF2_DEBRIS; // Set this flag to ensure that the explosion won't be effective more than 1 frame. } -void A_LandMineExplode(mobj_t *actor) +void A_LandMineExplode(void *thing) { - + mobj_t *actor = thing; mobj_t *expl; INT32 colour = SKINCOLOR_KETCHUP; // we spell words properly here INT32 i; @@ -11257,8 +11467,9 @@ void A_LandMineExplode(mobj_t *actor) } } -void A_BallhogExplode(mobj_t *actor) +void A_BallhogExplode(void *thing) { + mobj_t *actor = thing; mobj_t *mo2; if (LUA_CallAction(A_BALLHOGEXPLODE, actor)) @@ -11273,8 +11484,9 @@ void A_BallhogExplode(mobj_t *actor) // A_LightningFollowPlayer: // Dumb simple function that gives a mobj its target's momentums without updating its angle. -void A_LightningFollowPlayer(mobj_t *actor) +void A_LightningFollowPlayer(void *thing) { + mobj_t *actor = thing; fixed_t sx, sy; if (LUA_CallAction(A_LIGHTNINGFOLLOWPLAYER, actor)) @@ -11302,8 +11514,9 @@ void A_LightningFollowPlayer(mobj_t *actor) // A_FZBoomFlash: // Flash everyone close enough to the boom -void A_FZBoomFlash(mobj_t *actor) +void A_FZBoomFlash(void *thing) { + mobj_t *actor = thing; UINT8 i; if (LUA_CallAction(A_FZBOOMFLASH, actor)) @@ -11324,8 +11537,9 @@ void A_FZBoomFlash(mobj_t *actor) // A_FZBoomSmoke: // Spawns pinkish smoke around the object // Var1 is radius add -void A_FZBoomSmoke(mobj_t *actor) +void A_FZBoomSmoke(void *thing) { + mobj_t *actor = thing; INT32 i; INT32 rad = 47+(23*var1); @@ -11353,8 +11567,9 @@ void A_FZBoomSmoke(mobj_t *actor) // A_RandomShadowFrame // Gives a random sprite for the Mayonaka static shadows. Dumb and simple. -void A_RandomShadowFrame(mobj_t *actor) +void A_RandomShadowFrame(void *thing) { + mobj_t *actor = thing; mobj_t *fire; mobj_t *fake; @@ -11401,8 +11616,9 @@ void A_RandomShadowFrame(mobj_t *actor) // A_RoamingShadowThinker // Thinker for Midnight Channel's Roaming Shadows: -void A_RoamingShadowThinker(mobj_t *actor) +void A_RoamingShadowThinker(void *thing) { + mobj_t *actor = thing; mobj_t *wind; if (LUA_CallAction(A_ROAMINGSHADOWTHINKER, (actor))) @@ -11458,8 +11674,9 @@ void A_RoamingShadowThinker(mobj_t *actor) // A_MayonakaArrow // Used for the arrow sprite animations in Mayonaka. It's only extra visual bullshit to make em more random. -void A_MayonakaArrow(mobj_t *actor) +void A_MayonakaArrow(void *thing) { + mobj_t *actor = thing; INT32 flip = 0; INT32 iswarning; @@ -11497,8 +11714,9 @@ void A_MayonakaArrow(mobj_t *actor) // A_MementosTPParticles // Mementos teleporters particles effects. Short and simple. -void A_MementosTPParticles(mobj_t *actor) +void A_MementosTPParticles(void *thing) { + mobj_t *actor = thing; mobj_t *particle; mobj_t *mo2; int i = 0; @@ -11529,7 +11747,7 @@ void A_MementosTPParticles(mobj_t *actor) { for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -11545,8 +11763,9 @@ void A_MementosTPParticles(mobj_t *actor) // A_ReaperThinker // Mementos's Reaper's thinker. A huge pain in the Derek Bum to translate from Lua to this shite if you ask me. -void A_ReaperThinker(mobj_t *actor) +void A_ReaperThinker(void *thing) { + mobj_t *actor = thing; mobj_t *particle; // particles to spawn int i = 0; // for loops angle_t an = ANGLE_22h; // Reminder that angle constants suck. @@ -11634,7 +11853,7 @@ void A_ReaperThinker(mobj_t *actor) // We have no target and oughta find one, so let's scan through thinkers for a waypoint of angle 0, or something. for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -11699,7 +11918,7 @@ void A_ReaperThinker(mobj_t *actor) // If we reach close to a waypoint, then we should go to the NEXT one. for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; diff --git a/src/p_floor.c b/src/p_floor.c index 1856a051b..071f07327 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1688,7 +1688,7 @@ void EV_DoFloorOLD(mtag_t tag, line_t *line, floor_e floortype) sec->floordata = dofloor; // set up some generic aspects of the floormove_t - dofloor->thinker.function.acp1 = (actionf_p1)T_MoveFloor; + dofloor->thinker.function = (actionf_p1)T_MoveFloor; dofloor->type = floortype; dofloor->crush = false; // default: types that crush will change this dofloor->sector = sec; @@ -1809,7 +1809,7 @@ static floormove_t *CreateFloorThinker(sector_t *sec) sec->floordata = dofloor; // set up some generic aspects of the floormove_t - dofloor->thinker.function.acp1 = (actionf_p1)T_MoveFloor; + dofloor->thinker.function = (actionf_p1)T_MoveFloor; dofloor->sector = sec; dofloor->crush = false; // default: types that crush will change this @@ -2103,7 +2103,7 @@ static elevator_t *CreateElevatorThinker(sector_t *sec) sec->ceilingdata = elevator; // set up some generic aspects of the floormove_t - elevator->thinker.function.acp1 = (actionf_p1)T_MoveElevator; + elevator->thinker.function = (actionf_p1)T_MoveElevator; elevator->distance = 1; // Always crush unless otherwise elevator->sector = sec; @@ -2397,7 +2397,7 @@ void EV_BounceSector(sector_t *sec, fixed_t momz, line_t *sourceline) bouncer = Z_Calloc(sizeof (*bouncer), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &bouncer->thinker); sec->ceilingdata = bouncer; - bouncer->thinker.function.acp1 = (actionf_p1)T_BounceCheese; + bouncer->thinker.function = (actionf_p1)T_BounceCheese; // set up the fields according to the type of elevator action bouncer->sourceline = sourceline; @@ -2423,7 +2423,7 @@ void EV_DoContinuousFall(sector_t *sec, sector_t *backsector, fixed_t spd, boole // create and initialize new thinker faller = Z_Calloc(sizeof (*faller), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &faller->thinker); - faller->thinker.function.acp1 = (actionf_p1)T_ContinuousFalling; + faller->thinker.function = (actionf_p1)T_ContinuousFalling; // set up the fields faller->sector = sec; @@ -2459,7 +2459,7 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating, // create and initialize new crumble thinker crumble = Z_Calloc(sizeof (*crumble), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &crumble->thinker); - crumble->thinker.function.acp1 = (actionf_p1)T_StartCrumble; + crumble->thinker.function = (actionf_p1)T_StartCrumble; // set up the fields crumble->sector = sec; @@ -2535,7 +2535,7 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher) P_AddThinker(THINK_MAIN, &block->thinker); roversec->floordata = block; roversec->ceilingdata = block; - block->thinker.function.acp1 = (actionf_p1)T_MarioBlock; + block->thinker.function = (actionf_p1)T_MarioBlock; // Set up the fields block->sector = roversec; diff --git a/src/p_inter.c b/src/p_inter.c index d37a8faab..08ec0f7a0 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1509,7 +1509,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget // scan the thinkers to make sure all the old pinch dummies are gone on death for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; diff --git a/src/p_lights.c b/src/p_lights.c index 0853ec2d7..4935d2934 100644 --- a/src/p_lights.c +++ b/src/p_lights.c @@ -78,7 +78,7 @@ fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *sector, INT16 lighta, INT1 P_AddThinker(THINK_MAIN, &flick->thinker); - flick->thinker.function.acp1 = (actionf_p1)T_FireFlicker; + flick->thinker.function = (actionf_p1)T_FireFlicker; flick->sector = sector; flick->maxlight = max(lighta, lightb); flick->minlight = min(lighta, lightb); @@ -136,7 +136,7 @@ void P_SpawnLightningFlash(sector_t *sector) if (sector->lightingdata) { - if (((lightflash_t *)sector->lightingdata)->thinker.function.acp1 + if (((lightflash_t *)sector->lightingdata)->thinker.function == (actionf_p1)T_LightningFlash) { // lightning was already flashing in this sector @@ -153,7 +153,7 @@ void P_SpawnLightningFlash(sector_t *sector) P_AddThinker(THINK_MAIN, &flash->thinker); - flash->thinker.function.acp1 = (actionf_p1)T_LightningFlash; + flash->thinker.function = (actionf_p1)T_LightningFlash; flash->sector = sector; flash->maxlight = 255; flash->minlight = minlight; @@ -215,7 +215,7 @@ strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *sector, INT16 lighta, INT16 lig flash->sector = sector; flash->darktime = darktime; flash->brighttime = brighttime; - flash->thinker.function.acp1 = (actionf_p1)T_StrobeFlash; + flash->thinker.function = (actionf_p1)T_StrobeFlash; flash->maxlight = max(lighta, lightb); flash->minlight = min(lighta, lightb); @@ -285,7 +285,7 @@ glow_t *P_SpawnAdjustableGlowingLight(sector_t *sector, INT16 lighta, INT16 ligh g->sector = sector; g->minlight = min(lighta, lightb); g->maxlight = max(lighta, lightb); - g->thinker.function.acp1 = (actionf_p1)T_Glow; + g->thinker.function = (actionf_p1)T_Glow; g->direction = 1; g->speed = (INT16)(length/4); if (g->speed > (g->maxlight - g->minlight)/2) // don't make it ridiculous speed @@ -333,7 +333,7 @@ void P_FadeLightBySector(sector_t *sector, INT32 destvalue, INT32 speed, boolean } ll = Z_Calloc(sizeof (*ll), PU_LEVSPEC, NULL); - ll->thinker.function.acp1 = (actionf_p1)T_LightFade; + ll->thinker.function = (actionf_p1)T_LightFade; sector->lightingdata = ll; // set it to the lightlevel_t P_AddThinker(THINK_MAIN, &ll->thinker); // add thinker @@ -368,7 +368,7 @@ void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, bool { if (!force && ticbased // always let speed fader execute && sectors[i].lightingdata - && ((lightlevel_t*)sectors[i].lightingdata)->thinker.function.acp1 == (actionf_p1)T_LightFade) + && ((lightlevel_t*)sectors[i].lightingdata)->thinker.function == (actionf_p1)T_LightFade) // && ((lightlevel_t*)sectors[i].lightingdata)->timer > 2) { CONS_Debug(DBG_GAMELOGIC, "Line type 420 Executor: Fade light thinker already exists, timer: %d\n", ((lightlevel_t*)sectors[i].lightingdata)->timer); diff --git a/src/p_local.h b/src/p_local.h index 54be8014e..2e69088ee 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -335,7 +335,7 @@ void P_SceneryThinker(mobj_t *mobj); // To test it in Lua, check mobj.valid FUNCINLINE static ATTRINLINE boolean P_MobjWasRemoved(const mobj_t *mobj) { - return mobj == NULL || mobj->thinker.function.acp1 != (actionf_p1)P_MobjThinker; + return mobj == NULL || mobj->thinker.function != (actionf_p1)P_MobjThinker; } fixed_t P_MobjFloorZ(const mobj_t *mobj, const sector_t *sector, const sector_t *boundsec, fixed_t x, fixed_t y, const line_t *line, boolean lowest, boolean perfect); diff --git a/src/p_map.c b/src/p_map.c index c5b3407e6..35165999f 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3819,7 +3819,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) for (think = thlist[THINK_MAIN].next; think != &thlist[THINK_MAIN]; think = think->next) { - if (think->function.acp1 != (actionf_p1)T_StartCrumble) + if (think->function != (actionf_p1)T_StartCrumble) continue; crumbler = (crumble_t *)think; diff --git a/src/p_mobj.c b/src/p_mobj.c index 7da13db4f..7a3ce36e3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -96,7 +96,7 @@ void P_RunCachedActions(void) var2 = states[ac->statenum].var2; astate = &states[ac->statenum]; if (ac->mobj && !P_MobjWasRemoved(ac->mobj)) // just in case... - states[ac->statenum].action.acp1(ac->mobj); + states[ac->statenum].action(ac->mobj); next = ac->next; Z_Free(ac); } @@ -116,7 +116,7 @@ void P_AddCachedAction(mobj_t *mobj, INT32 statenum) static inline INT32 randomframe (mobj_t *mobj, INT32 n) { // Only mobj thinkers should use synced RNG - if (mobj->thinker.function.acp1 == (actionf_p1)P_MobjThinker) + if (mobj->thinker.function == (actionf_p1)P_MobjThinker) return P_RandomKey(n); else return M_RandomKey(n); @@ -387,12 +387,12 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) // Modified handling. // Call action functions when the state is set - if (st->action.acp1) + if (st->action) { var1 = st->var1; var2 = st->var2; astate = st; - st->action.acp1(mobj); + st->action(mobj); // woah. a player was removed by an action. // this sounds like a VERY BAD THING, but there's nothing we can do now... @@ -511,12 +511,12 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) // Modified handling. // Call action functions when the state is set - if (st->action.acp1) + if (st->action) { var1 = st->var1; var2 = st->var2; astate = st; - st->action.acp1(mobj); + st->action(mobj); if (P_MobjWasRemoved(mobj)) return false; } @@ -3658,7 +3658,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled { mobj_t dummy; - dummy.thinker.function.acp1 = (actionf_p1)P_MobjThinker; + dummy.thinker.function = (actionf_p1)P_MobjThinker; dummy.subsector = thiscam->subsector; dummy.x = thiscam->x; dummy.y = thiscam->y; @@ -4612,7 +4612,7 @@ static void P_Boss3Thinker(mobj_t *mobj) // this can happen if the boss was hurt earlier than expected for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -4703,7 +4703,7 @@ static void P_Boss3Thinker(mobj_t *mobj) // the number for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -5330,7 +5330,7 @@ static void P_Boss7Thinker(mobj_t *mobj) // Find waypoint he is closest to for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -5385,7 +5385,7 @@ static void P_Boss7Thinker(mobj_t *mobj) // the waypoint to use for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -5510,7 +5510,7 @@ static void P_Boss9Thinker(mobj_t *mobj) // Build a hoop linked list of 'em! for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -5965,7 +5965,7 @@ mobj_t *P_GetClosestAxis(mobj_t *source) // scan the thinkers to find the closest axis point for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; @@ -10302,13 +10302,13 @@ static void P_FiringThink(mobj_t *mobj) if (mobj->health <= 0) return; - if (mobj->state->action.acp1 == (actionf_p1)A_Boss1Laser) + if (mobj->state->action == (actionf_p1)A_Boss1Laser) { if (mobj->state->tics > 1) { var1 = mobj->state->var1; var2 = mobj->state->var2 & 65535; - mobj->state->action.acp1(mobj); + mobj->state->action(mobj); } } else if (leveltime & 1) // Fire mode @@ -11151,7 +11151,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj = P_AllocateMobj(); // this is officially a mobj, declared as soon as possible. - mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker; + mobj->thinker.function = (actionf_p1)P_MobjThinker; mobj->type = type; mobj->info = info; @@ -11310,7 +11310,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) ball->threshold = ball->radius + mobj->radius + FixedMul(ball->info->painchance, ball->scale); var1 = ball->state->var1, var2 = ball->state->var2; - ball->state->action.acp1(ball); + ball->state->action(ball); } } break; @@ -11635,7 +11635,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) } // Call action functions when the state is set - if (st->action.acp1 && (mobj->flags & MF_RUNSPAWNFUNC)) + if (st->action && (mobj->flags & MF_RUNSPAWNFUNC)) { if (levelloading == true) { @@ -11650,7 +11650,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) var1 = st->var1; var2 = st->var2; astate = st; - st->action.acp1(mobj); + st->action(mobj); // DANGER! This can cause P_SpawnMobj to return NULL! // Avoid using MF_RUNSPAWNFUNC on mobjs whose spawn state expects target or tracer to already be set! if (P_MobjWasRemoved(mobj)) @@ -11709,7 +11709,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype start_z = mobj->floorz; - mobj->thinker.function.acp1 = (actionf_p1)P_NullPrecipThinker; + mobj->thinker.function = (actionf_p1)P_NullPrecipThinker; P_AddThinker(THINK_PRECIP, &mobj->thinker); P_CalculatePrecipFloor(mobj); @@ -11768,9 +11768,9 @@ void P_RemoveMobj(mobj_t *mobj) if (P_MobjWasRemoved(mobj)) return; // something already removing this mobj. - mobj->thinker.function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing. + mobj->thinker.function = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing. LUA_HookMobj(mobj, MOBJ_HOOK(MobjRemoved)); - mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker; // needed for P_UnsetThingPosition, etc. to work. + mobj->thinker.function = (actionf_p1)P_MobjThinker; // needed for P_UnsetThingPosition, etc. to work. // Rings only, please! if (mobj->spawnpoint && @@ -11928,7 +11928,7 @@ void P_FreePrecipMobj(precipmobj_t *mobj) // Clearing out stuff for savegames void P_RemoveSavegameMobj(mobj_t *mobj) { - if (((thinker_t *)mobj)->function.acp1 == (actionf_p1)P_NullPrecipThinker) + if (((thinker_t *)mobj)->function == (actionf_p1)P_NullPrecipThinker) { // unlink from sector and block lists P_UnsetPrecipThingPosition((precipmobj_t *)mobj); @@ -13340,7 +13340,7 @@ static boolean P_MapAlreadyHasStarPost(mobj_t *mobj) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; diff --git a/src/p_polyobj.c b/src/p_polyobj.c index f161ca833..f5f0305a6 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -1314,7 +1314,7 @@ void Polyobj_InitLevel(void) // the mobj_t pointers on a queue for use below. for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; @@ -2030,7 +2030,7 @@ boolean EV_DoPolyObjRotate(polyrotdata_t *prdata) // create a new thinker th = Z_Malloc(sizeof(polyrotate_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjRotate; + th->thinker.function = (actionf_p1)T_PolyObjRotate; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; @@ -2102,7 +2102,7 @@ boolean EV_DoPolyObjMove(polymovedata_t *pmdata) // create a new thinker th = Z_Malloc(sizeof(polymove_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjMove; + th->thinker.function = (actionf_p1)T_PolyObjMove; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; @@ -2164,7 +2164,7 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata) // create a new thinker th = Z_Malloc(sizeof(polywaypoint_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjWaypoint; + th->thinker.function = (actionf_p1)T_PolyObjWaypoint; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; @@ -2231,7 +2231,7 @@ static void Polyobj_doSlideDoor(polyobj_t *po, polydoordata_t *doordata) // allocate and add a new slide door thinker th = Z_Malloc(sizeof(polyslidedoor_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyDoorSlide; + th->thinker.function = (actionf_p1)T_PolyDoorSlide; P_AddThinker(THINK_POLYOBJ, &th->thinker); // point the polyobject to this thinker @@ -2282,7 +2282,7 @@ static void Polyobj_doSwingDoor(polyobj_t *po, polydoordata_t *doordata) // allocate and add a new swing door thinker th = Z_Malloc(sizeof(polyswingdoor_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyDoorSwing; + th->thinker.function = (actionf_p1)T_PolyDoorSwing; P_AddThinker(THINK_POLYOBJ, &th->thinker); // point the polyobject to this thinker @@ -2367,7 +2367,7 @@ boolean EV_DoPolyObjDisplace(polydisplacedata_t *prdata) // create a new thinker th = Z_Malloc(sizeof(polydisplace_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjDisplace; + th->thinker.function = (actionf_p1)T_PolyObjDisplace; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; @@ -2416,7 +2416,7 @@ boolean EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *prdata) // create a new thinker th = Z_Malloc(sizeof(polyrotdisplace_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjRotDisplace; + th->thinker.function = (actionf_p1)T_PolyObjRotDisplace; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; @@ -2521,7 +2521,7 @@ boolean EV_DoPolyObjFlag(polyflagdata_t *pfdata) // create a new thinker th = Z_Malloc(sizeof(polymove_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjFlag; + th->thinker.function = (actionf_p1)T_PolyObjFlag; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; @@ -2669,12 +2669,12 @@ boolean EV_DoPolyObjFade(polyfadedata_t *pfdata) if (po->translucency == pfdata->destvalue) return true; - if (po->thinker && po->thinker->function.acp1 == (actionf_p1)T_PolyObjFade) + if (po->thinker && po->thinker->function == (actionf_p1)T_PolyObjFade) P_RemoveThinker(po->thinker); // create a new thinker th = Z_Malloc(sizeof(polyfade_t), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_PolyObjFade; + th->thinker.function = (actionf_p1)T_PolyObjFade; P_AddThinker(THINK_POLYOBJ, &th->thinker); po->thinker = &th->thinker; diff --git a/src/p_saveg.c b/src/p_saveg.c index 68d825df2..5d5c01140 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2082,7 +2082,7 @@ static thinker_t *SyncMobjThinker(savebuffer_t *save, actionf_p1 thinker, thinke mobj = P_AllocateMobj(); // declare this as a valid mobj as soon as possible. - mobj->thinker.function.acp1 = thinker; + mobj->thinker.function = thinker; // manually link to thinkerlist, since the thinker isn't returned anymore if (!save->write) @@ -2381,7 +2381,7 @@ static thinker_t *SyncNoEnemiesThinker(savebuffer_t *save, actionf_p1 thinker, t else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sourceline); return &ht->thinker; @@ -2397,7 +2397,7 @@ static thinker_t *SyncBounceCheeseThinker(savebuffer_t *save, actionf_p1 thinker else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sourceline); @@ -2422,7 +2422,7 @@ static thinker_t *SyncContinuousFallThinker(savebuffer_t *save, actionf_p1 think else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -2449,7 +2449,7 @@ static thinker_t *SyncMarioBlockThinker(savebuffer_t *save, actionf_p1 thinker, else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -2476,7 +2476,7 @@ static thinker_t *SyncMarioCheckThinker(savebuffer_t *save, actionf_p1 thinker, else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sourceline); @@ -2494,7 +2494,7 @@ static thinker_t *SyncThwompThinker(savebuffer_t *save, actionf_p1 thinker, thin else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sourceline); @@ -2526,7 +2526,7 @@ static thinker_t *SyncFloatThinker(savebuffer_t *save, actionf_p1 thinker, think else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sourceline); @@ -2545,7 +2545,7 @@ static thinker_t *SyncEachTimeThinker(savebuffer_t *save, actionf_p1 thinker, th else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } size_t i; @@ -2568,7 +2568,7 @@ static thinker_t *SyncRaiseThinker(savebuffer_t *save, actionf_p1 thinker, think else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->tag); @@ -2592,7 +2592,7 @@ static thinker_t *SyncCeilingThinker(savebuffer_t *save, actionf_p1 thinker, thi else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->type); @@ -2628,7 +2628,7 @@ static thinker_t *SyncFloormoveThinker(savebuffer_t *save, actionf_p1 thinker, t else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->type); @@ -2660,7 +2660,7 @@ static thinker_t *SyncLightflashThinker(savebuffer_t *save, actionf_p1 thinker, else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); SYNC(ht->maxlight); @@ -2680,7 +2680,7 @@ static thinker_t *SyncStrobeThinker(savebuffer_t *save, actionf_p1 thinker, thin else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -2704,7 +2704,7 @@ static thinker_t *SyncGlowThinker(savebuffer_t *save, actionf_p1 thinker, thinke else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -2727,7 +2727,7 @@ static thinker_t *SyncFireflickerThinker(savebuffer_t *save, actionf_p1 thinker, else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -2751,7 +2751,7 @@ static thinker_t *SyncElevatorThinker(savebuffer_t *save, actionf_p1 thinker, th else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->type); @@ -2788,7 +2788,7 @@ static thinker_t *SyncCrumbleThinker(savebuffer_t *save, actionf_p1 thinker, thi else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sourceline); @@ -2819,7 +2819,7 @@ static thinker_t *SyncScrollThinker(savebuffer_t *save, actionf_p1 thinker, thin else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->dx); @@ -2845,7 +2845,7 @@ static thinker_t *SyncFrictionThinker(savebuffer_t *save, actionf_p1 thinker, th else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->friction); @@ -2866,7 +2866,7 @@ static thinker_t *SyncPusherThinker(savebuffer_t *save, actionf_p1 thinker, thin else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->type); @@ -2891,7 +2891,7 @@ static thinker_t *SyncLaserThinker(savebuffer_t *save, actionf_p1 thinker, think else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->tag); @@ -2910,7 +2910,7 @@ static thinker_t *SyncLightlevelThinker(savebuffer_t *save, actionf_p1 thinker, else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -2934,7 +2934,7 @@ static thinker_t *SyncExecutorThinker(savebuffer_t *save, actionf_p1 thinker, th else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->line); @@ -2954,7 +2954,7 @@ static thinker_t *SyncDisappearThinker(savebuffer_t *save, actionf_p1 thinker, t else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->appeartime); @@ -2977,7 +2977,7 @@ static thinker_t *SyncFadeThinker(savebuffer_t *save, actionf_p1 thinker, thinke else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } ht->dest_exc = GetNetColormapFromList(P_SyncUINT32(save, CheckAddNetColormapToList(ht->dest_exc))); @@ -3030,7 +3030,7 @@ static thinker_t *SyncFadeColormapThinker(savebuffer_t *save, actionf_p1 thinker else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->sector); @@ -3054,7 +3054,7 @@ static thinker_t *SyncPlaneDisplaceThinker(savebuffer_t *save, actionf_p1 thinke else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->affectee); @@ -3075,7 +3075,7 @@ static thinker_t *SyncDynamicLineSlopeThinker(savebuffer_t *save, actionf_p1 thi else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->type); @@ -3096,7 +3096,7 @@ static thinker_t *SyncDynamicVertexSlopeThinker(savebuffer_t *save, actionf_p1 t else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->slope); @@ -3119,7 +3119,7 @@ static thinker_t *SyncPolyrotatetThinker(savebuffer_t *save, actionf_p1 thinker, else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3139,7 +3139,7 @@ static thinker_t *SyncPolymoveThinker(savebuffer_t *save, actionf_p1 thinker, th else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3161,7 +3161,7 @@ static thinker_t *SyncPolywaypointThinker(savebuffer_t *save, actionf_p1 thinker else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3185,7 +3185,7 @@ static thinker_t *SyncPolyslidedoorThinker(savebuffer_t *save, actionf_p1 thinke else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3214,7 +3214,7 @@ static thinker_t *SyncPolyswingdoorThinker(savebuffer_t *save, actionf_p1 thinke else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3238,7 +3238,7 @@ static thinker_t *SyncPolydisplaceThinker(savebuffer_t *save, actionf_p1 thinker else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3259,7 +3259,7 @@ static thinker_t *SyncPolyrotdisplaceThinker(savebuffer_t *save, actionf_p1 thin else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3280,7 +3280,7 @@ static thinker_t *SyncPolyfadeThinker(savebuffer_t *save, actionf_p1 thinker, th else { ht = Z_Calloc(sizeof (*ht), PU_LEVSPEC, NULL); - ht->thinker.function.acp1 = thinker; + ht->thinker.function = thinker; } SYNC(ht->polyObjNum); @@ -3381,7 +3381,7 @@ static void P_NetSyncThinkers(savebuffer_t *save) currentthinker->references = 0; // Heinous but this is the only place the assertion in P_UnlinkThinkers is wrong - if (currentthinker->function.acp1 == (actionf_p1)P_MobjThinker || currentthinker->function.acp1 == (actionf_p1)P_NullPrecipThinker) + if (currentthinker->function == (actionf_p1)P_MobjThinker || currentthinker->function == (actionf_p1)P_NullPrecipThinker) P_RemoveSavegameMobj((mobj_t *)currentthinker); // item isn't saved, don't remove it else { @@ -3425,7 +3425,7 @@ static void P_NetSyncThinkers(savebuffer_t *save) break; } - acp = th->function.acp1; + acp = th->function; if (acp == (actionf_p1)P_NullPrecipThinker || acp == (actionf_p1)P_RemoveThinkerDelayed) continue; } @@ -3472,7 +3472,7 @@ static void P_NetSyncThinkers(savebuffer_t *save) executor_t *delay; for (currentthinker = thlist[THINK_MAIN].next; currentthinker != &thlist[THINK_MAIN]; currentthinker = currentthinker->next) { - if (currentthinker->function.acp1 != (actionf_p1)T_ExecutorDelay) + if (currentthinker->function != (actionf_p1)T_ExecutorDelay) continue; delay = (executor_t *)currentthinker; RELINK(&delay->caller); @@ -3537,7 +3537,7 @@ mobj_t *P_FindNewPosition(UINT32 oldposition) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mobj = (mobj_t *)th; @@ -3635,7 +3635,7 @@ static void P_RelinkPointers(savebuffer_t *save) for (currentthinker = thlist[THINK_MOBJ].next; currentthinker != &thlist[THINK_MOBJ]; currentthinker = currentthinker->next) { - if (currentthinker->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (currentthinker->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mobj = (mobj_t *)currentthinker; @@ -4341,7 +4341,7 @@ void P_SaveNetGame(savebuffer_t *save, boolean resending) { for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mobj = (mobj_t *)th; diff --git a/src/p_setup.c b/src/p_setup.c index 60ae6591c..b9a98b642 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -665,7 +665,7 @@ void P_ReloadRings(void) // scan the thinkers to find rings/spheres/hoops to unset for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)th; @@ -8185,7 +8185,7 @@ void P_RespawnThings(void) for (think = thlist[THINK_MOBJ].next; think != &thlist[THINK_MOBJ]; think = think->next) { - if (think->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (think->function == (actionf_p1)P_RemoveThinkerDelayed) continue; P_RemoveMobj((mobj_t *)think); } diff --git a/src/p_slopes.c b/src/p_slopes.c index 592123632..1b93aafdc 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -305,7 +305,7 @@ void T_DynamicSlopeVert (dynvertexplanethink_t* th) static inline void P_AddDynLineSlopeThinker (pslope_t* slope, dynplanetype_t type, line_t* sourceline, fixed_t extent) { dynlineplanethink_t* th = Z_Calloc(sizeof (*th), PU_LEVSPEC, NULL); - th->thinker.function.acp1 = (actionf_p1)T_DynamicSlopeLine; + th->thinker.function = (actionf_p1)T_DynamicSlopeLine; th->slope = slope; th->type = type; th->sourceline = sourceline; @@ -321,7 +321,7 @@ static inline void P_AddDynVertexSlopeThinker (pslope_t* slope, const INT16 tags dynvertexplanethink_t* th = Z_Calloc(sizeof (*th), PU_LEVSPEC, NULL); size_t i; INT32 l; - th->thinker.function.acp1 = (actionf_p1)T_DynamicSlopeVert; + th->thinker.function = (actionf_p1)T_DynamicSlopeVert; th->slope = slope; for (i = 0; i < 3; i++) { diff --git a/src/p_spec.c b/src/p_spec.c index fc9837b51..28bb027ec 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1025,7 +1025,7 @@ static boolean PolyFade(INT32 *args) // Prevent continuous execs from interfering on an existing fade if (!(args[3] & TMPF_OVERRIDE) && po->thinker - && po->thinker->function.acp1 == (actionf_p1)T_PolyObjFade) + && po->thinker->function == (actionf_p1)T_PolyObjFade) { CONS_Debug(DBG_POLYOBJ, "Line type 492 Executor: Fade PolyObject thinker already exists\n"); return 0; @@ -1240,7 +1240,7 @@ static void P_AddExecutorDelay(line_t *line, mobj_t *mobj, sector_t *sector) e = Z_Calloc(sizeof (*e), PU_LEVSPEC, NULL); - e->thinker.function.acp1 = (actionf_p1)T_ExecutorDelay; + e->thinker.function = (actionf_p1)T_ExecutorDelay; e->line = line; e->sector = sector; e->timer = delay; @@ -1827,7 +1827,7 @@ void P_SwitchWeather(preciptype_t newWeather) { next = think->next; - if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker) + if (think->function != (actionf_p1)P_NullPrecipThinker) continue; // not a precipmobj thinker precipmobj = (precipmobj_t *)think; @@ -1843,7 +1843,7 @@ void P_SwitchWeather(preciptype_t newWeather) for (think = thlist[THINK_PRECIP].next; think != &thlist[THINK_PRECIP]; think = think->next) { - if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker) + if (think->function != (actionf_p1)P_NullPrecipThinker) continue; // not a precipmobj thinker precipmobj = (precipmobj_t *)think; @@ -3266,7 +3266,7 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha for (th = thlist[THINK_MAIN].next; th != &thlist[THINK_MAIN]; th = th->next) { - if (th->function.acp1 != (actionf_p1)T_Scroll) + if (th->function != (actionf_p1)T_Scroll) continue; scroller = (scroll_t *)th; @@ -4223,7 +4223,7 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha if (mo2->type != MT_EGGTRAP) continue; - if (mo2->thinker.function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (mo2->thinker.function == (actionf_p1)P_RemoveThinkerDelayed) continue; P_KillMobj(mo2, NULL, mo, DMG_NORMAL); @@ -4582,7 +4582,7 @@ void P_SetupSignExit(player_t *player) // spin all signposts in the level then. for (think = thlist[THINK_MOBJ].next; think != &thlist[THINK_MOBJ]; think = think->next) { - if (think->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (think->function == (actionf_p1)P_RemoveThinkerDelayed) continue; thing = (mobj_t *)think; @@ -5070,7 +5070,7 @@ static void P_ProcessEggCapsule(player_t *player, sector_t *sector) // The chimps are my friends.. heeheeheheehehee..... - LouisJM for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo2 = (mobj_t *)th; if (mo2->type != MT_EGGTRAP) @@ -6327,7 +6327,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I break; // Should this FOF have friction? - if(th->function.acp1 == (actionf_p1)T_Friction) + if(th->function == (actionf_p1)T_Friction) { f = (friction_t *)th; @@ -6335,7 +6335,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I Add_Friction(f->friction, f->movefactor, (INT32)(sec-sectors), f->affectee); } // Should this FOF have wind/current/pusher? - else if(th->function.acp1 == (actionf_p1)T_Pusher) + else if(th->function == (actionf_p1)T_Pusher) { p = (pusher_t *)th; @@ -6470,7 +6470,7 @@ static void P_AddFloatThinker(sector_t *sec, UINT16 tag, line_t *sourceline) floater = Z_Calloc(sizeof (*floater), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &floater->thinker); - floater->thinker.function.acp1 = (actionf_p1)T_FloatSector; + floater->thinker.function = (actionf_p1)T_FloatSector; floater->sector = sec; floater->tag = (INT16)tag; @@ -6501,7 +6501,7 @@ static void P_AddPlaneDisplaceThinker(INT32 type, fixed_t speed, INT32 control, displace = Z_Calloc(sizeof (*displace), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &displace->thinker); - displace->thinker.function.acp1 = (actionf_p1)T_PlaneDisplace; + displace->thinker.function = (actionf_p1)T_PlaneDisplace; displace->affectee = affectee; displace->control = control; displace->last_height = sectors[control].floorheight; @@ -6531,7 +6531,7 @@ static void P_AddBlockThinker(sector_t *sec, line_t *sourceline) block = Z_Calloc(sizeof (*block), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &block->thinker); - block->thinker.function.acp1 = (actionf_p1)T_MarioBlockChecker; + block->thinker.function = (actionf_p1)T_MarioBlockChecker; block->sourceline = sourceline; block->sector = sec; @@ -6556,7 +6556,7 @@ static void P_AddRaiseThinker(sector_t *sec, INT16 tag, fixed_t speed, fixed_t c raise = Z_Calloc(sizeof (*raise), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &raise->thinker); - raise->thinker.function.acp1 = (actionf_p1)T_RaiseSector; + raise->thinker.function = (actionf_p1)T_RaiseSector; raise->tag = tag; raise->sector = sec; @@ -6582,7 +6582,7 @@ static void P_AddAirbob(sector_t *sec, INT16 tag, fixed_t dist, boolean raise, b airbob = Z_Calloc(sizeof (*airbob), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &airbob->thinker); - airbob->thinker.function.acp1 = (actionf_p1)T_RaiseSector; + airbob->thinker.function = (actionf_p1)T_RaiseSector; airbob->tag = tag; airbob->sector = sec; @@ -6622,7 +6622,7 @@ static inline void P_AddThwompThinker(sector_t *sec, line_t *sourceline, fixed_t thwomp = Z_Calloc(sizeof (*thwomp), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &thwomp->thinker); - thwomp->thinker.function.acp1 = (actionf_p1)T_ThwompSector; + thwomp->thinker.function = (actionf_p1)T_ThwompSector; // set up the fields according to the type of elevator action thwomp->sourceline = sourceline; @@ -6662,7 +6662,7 @@ static inline void P_AddNoEnemiesThinker(line_t *sourceline) nobaddies = Z_Calloc(sizeof (*nobaddies), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &nobaddies->thinker); - nobaddies->thinker.function.acp1 = (actionf_p1)T_NoEnemiesSector; + nobaddies->thinker.function = (actionf_p1)T_NoEnemiesSector; nobaddies->sourceline = sourceline; } @@ -6682,7 +6682,7 @@ static void P_AddEachTimeThinker(line_t *sourceline, boolean triggerOnExit) eachtime = Z_Calloc(sizeof (*eachtime), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &eachtime->thinker); - eachtime->thinker.function.acp1 = (actionf_p1)T_EachTimeThinker; + eachtime->thinker.function = (actionf_p1)T_EachTimeThinker; eachtime->sourceline = sourceline; eachtime->triggerOnExit = triggerOnExit; @@ -6706,7 +6706,7 @@ static inline void P_AddCameraScanner(sector_t *sourcesec, sector_t *actionsecto elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &elevator->thinker); - elevator->thinker.function.acp1 = (actionf_p1)T_CameraScanner; + elevator->thinker.function = (actionf_p1)T_CameraScanner; elevator->type = elevateBounce; // set up the fields according to the type of elevator action @@ -6790,7 +6790,7 @@ static inline void P_AddLaserThinker(INT16 tag, line_t *line, boolean nobosses) P_AddThinker(THINK_MAIN, &flash->thinker); - flash->thinker.function.acp1 = (actionf_p1)T_LaserFlash; + flash->thinker.function = (actionf_p1)T_LaserFlash; flash->tag = tag; flash->sourceline = line; flash->nobosses = nobosses; @@ -7020,9 +7020,9 @@ void P_SpawnSpecials(boolean fromnetsave) // Firstly, find out how many there are in each sector for (th = thlist[THINK_MAIN].next; th != &thlist[THINK_MAIN]; th = th->next) { - if (th->function.acp1 == (actionf_p1)T_Friction) + if (th->function == (actionf_p1)T_Friction) secthinkers[((friction_t *)th)->affectee].count++; - else if (th->function.acp1 == (actionf_p1)T_Pusher) + else if (th->function == (actionf_p1)T_Pusher) secthinkers[((pusher_t *)th)->affectee].count++; } @@ -7040,9 +7040,9 @@ void P_SpawnSpecials(boolean fromnetsave) { size_t secnum = (size_t)-1; - if (th->function.acp1 == (actionf_p1)T_Friction) + if (th->function == (actionf_p1)T_Friction) secnum = ((friction_t *)th)->affectee; - else if (th->function.acp1 == (actionf_p1)T_Pusher) + else if (th->function == (actionf_p1)T_Pusher) secnum = ((pusher_t *)th)->affectee; if (secnum != (size_t)-1) @@ -8347,7 +8347,7 @@ static boolean IsSector3DBlock(sector_t* sec) static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT32 affectee, INT32 accel, INT32 exclusive) { scroll_t *s = Z_Calloc(sizeof *s, PU_LEVSPEC, NULL); - s->thinker.function.acp1 = (actionf_p1)T_Scroll; + s->thinker.function = (actionf_p1)T_Scroll; s->type = type; s->dx = dx; s->dy = dy; @@ -8503,7 +8503,7 @@ static void Add_MasterDisappearer(tic_t appeartime, tic_t disappeartime, tic_t o { disappear_t *d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); - d->thinker.function.acp1 = (actionf_p1)T_Disappear; + d->thinker.function = (actionf_p1)T_Disappear; d->appeartime = appeartime; d->disappeartime = disappeartime; d->offset = offset; @@ -8898,7 +8898,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); - d->thinker.function.acp1 = (actionf_p1)T_Fade; + d->thinker.function = (actionf_p1)T_Fade; d->rover = rover; d->sectornum = (UINT32)sectornum; d->ffloornum = (UINT32)ffloornum; @@ -9050,7 +9050,7 @@ static void Add_ColormapFader(sector_t *sector, extracolormap_t *source_exc, ext } d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); - d->thinker.function.acp1 = (actionf_p1)T_FadeColormap; + d->thinker.function = (actionf_p1)T_FadeColormap; d->sector = sector; d->source_exc = source_exc; d->dest_exc = dest_exc; @@ -9174,7 +9174,7 @@ static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 { friction_t *f = Z_Calloc(sizeof *f, PU_LEVSPEC, NULL); - f->thinker.function.acp1 = (actionf_p1)T_Friction; + f->thinker.function = (actionf_p1)T_Friction; f->friction = friction; f->movefactor = movefactor; f->affectee = affectee; @@ -9331,7 +9331,7 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, fixed_t { pusher_t *p = Z_Calloc(sizeof *p, PU_LEVSPEC, NULL); - p->thinker.function.acp1 = (actionf_p1)T_Pusher; + p->thinker.function = (actionf_p1)T_Pusher; p->type = type; p->x_mag = x_mag; p->y_mag = y_mag; diff --git a/src/p_tick.c b/src/p_tick.c index 0c5a96976..6dd793d9e 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -132,7 +132,7 @@ void Command_Numthinkers_f(void) { for (think = thlist[i].next; think != &thlist[i]; think = think->next) { - if (think->function.acp1 != action) + if (think->function != action) continue; count++; @@ -170,7 +170,7 @@ void Command_CountMobjs_f(void) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; if (((mobj_t *)th)->type == i) @@ -190,7 +190,7 @@ void Command_CountMobjs_f(void) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; if (((mobj_t *)th)->type == i) @@ -262,7 +262,7 @@ void P_AddThinker(const thinklistnum_t n, thinker_t *thinker) #ifdef PARANOIA static const char *MobjTypeName(const mobj_t *mobj) { - actionf_p1 p1 = mobj->thinker.function.acp1; + actionf_p1 p1 = mobj->thinker.function; if (p1 == (actionf_p1)P_MobjThinker) { @@ -281,7 +281,7 @@ static const char *MobjTypeName(const mobj_t *mobj) static const char *MobjThinkerName(const mobj_t *mobj) { - actionf_p1 p1 = mobj->thinker.function.acp1; + actionf_p1 p1 = mobj->thinker.function; if (p1 == (actionf_p1)P_MobjThinker) { @@ -397,7 +397,7 @@ void P_UnlinkThinker(thinker_t *thinker) void P_RemoveThinker(thinker_t *thinker) { LUA_InvalidateUserdata(thinker); - thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; + thinker->function = (actionf_p1)P_RemoveThinkerDelayed; } /* @@ -486,9 +486,9 @@ static void P_RunThinkers(void) for (currentthinker = thlist[i].next; currentthinker != &thlist[i]; currentthinker = currentthinker->next) { #ifdef PARANOIA - I_Assert(currentthinker->function.acp1 != NULL); + I_Assert(currentthinker->function != NULL); #endif - currentthinker->function.acp1(currentthinker); + currentthinker->function(currentthinker); } ps_thlist_times[i] = I_GetPreciseTime() - ps_thlist_times[i]; } diff --git a/src/p_user.c b/src/p_user.c index d13c794a1..0f20413d3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2465,7 +2465,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) for (think = thlist[THINK_MOBJ].next; think != &thlist[THINK_MOBJ]; think = think->next) { - if (think->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (think->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mo = (mobj_t *)think; @@ -3620,7 +3620,7 @@ static mobj_t *P_GetAxis(INT32 num) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + if (th->function == (actionf_p1)P_RemoveThinkerDelayed) continue; mobj = (mobj_t *)th; diff --git a/src/r_data.c b/src/r_data.c index 0e9820e58..58c140214 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1326,7 +1326,7 @@ static void R_PrecacheLevelSprites(void) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) + if (th->function != (actionf_p1)P_MobjThinker) continue; spritepresent[((mobj_t *)th)->sprite] = 1;