diff --git a/src/doomdata.h b/src/doomdata.h index 9d3873364..32cc1e9db 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -271,9 +271,9 @@ struct mapthing_t mtag_t tid; fixed_t scale; fixed_t spritexscale, spriteyscale; + INT32 thing_args[NUM_MAPTHING_ARGS]; + char *thing_stringargs[NUM_MAPTHING_STRINGARGS]; INT16 special; - INT32 args[NUM_MAPTHING_ARGS]; - char *stringargs[NUM_MAPTHING_STRINGARGS]; INT32 script_args[NUM_SCRIPT_ARGS]; char *script_stringargs[NUM_SCRIPT_STRINGARGS]; UINT8 layer; // FOF layer to spawn on, see P_GetMobjSpawnHeight diff --git a/src/g_demo.c b/src/g_demo.c index 7f58d289e..38a2e15bf 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -3760,7 +3760,7 @@ void G_AddGhost(savebuffer_t *buffer, char *defdemoname) gh->mo->angle = FixedAngle(mthing->angle << FRACBITS); f = gh->mo->floorz; c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height; - if (!!(mthing->args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP)) + if (!!(mthing->thing_args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP)) { z = c - offset; if (z < f) diff --git a/src/k_battle.c b/src/k_battle.c index 4daa5afe4..7020e7fcf 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -712,10 +712,10 @@ void K_RunBattleOvertime(void) void K_SetupMovingCapsule(mapthing_t *mt, mobj_t *mobj) { - UINT8 sequence = mt->args[0] - 1; - fixed_t speed = (FRACUNIT >> 3) * mt->args[1]; - boolean backandforth = (mt->args[2] & TMBCF_BACKANDFORTH); - boolean reverse = (mt->args[2] & TMBCF_REVERSE); + UINT8 sequence = mt->thing_args[0] - 1; + fixed_t speed = (FRACUNIT >> 3) * mt->thing_args[1]; + boolean backandforth = (mt->thing_args[2] & TMBCF_BACKANDFORTH); + boolean reverse = (mt->thing_args[2] & TMBCF_REVERSE); mobj_t *target = NULL; // Find the inital target diff --git a/src/k_kart.c b/src/k_kart.c index 08e80e2cf..193da3181 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -77,7 +77,7 @@ boolean K_IsDuelItem(mobjtype_t type) boolean K_DuelItemAlwaysSpawns(mapthing_t *mt) { - return !!(mt->args[0]); + return !!(mt->thing_args[0]); } static void K_SpawnDuelOnlyItems(void) @@ -122,14 +122,14 @@ static void K_SpawnItemCapsules(void) continue; } - isRingCapsule = (mt->args[0] < 1 || mt->args[0] == KITEM_SUPERRING || mt->args[0] >= NUMKARTITEMS); + isRingCapsule = (mt->thing_args[0] < 1 || mt->thing_args[0] == KITEM_SUPERRING || mt->thing_args[0] >= NUMKARTITEMS); if (isRingCapsule == true && ((gametyperules & GTR_SPHERES) || (modeattacking & ATTACKING_SPB))) { // don't spawn ring capsules in ringless gametypes continue; } - modeFlags = mt->args[3]; + modeFlags = mt->thing_args[3]; if (modeFlags == TMICM_DEFAULT) { if (isRingCapsule == true) diff --git a/src/k_waypoint.cpp b/src/k_waypoint.cpp index cab010095..127cee7a0 100644 --- a/src/k_waypoint.cpp +++ b/src/k_waypoint.cpp @@ -2399,7 +2399,7 @@ static boolean K_AnchorWaypointRadius( anchor->x, anchor->y); // Keep changes for -writetextmap - waypointmobj->spawnpoint->args[1] = waypointmobj->radius >> FRACBITS; + waypointmobj->spawnpoint->thing_args[1] = waypointmobj->radius >> FRACBITS; return true; } else diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 023f9bd75..ce4668038 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -488,10 +488,10 @@ static int mobj_get(lua_State *L) lua_pushinteger(L, mo->special); break; case mobj_args: - LUA_PushUserdata(L, mo->args, META_THINGARGS); + LUA_PushUserdata(L, mo->thing_args, META_THINGARGS); break; case mobj_stringargs: - LUA_PushUserdata(L, mo->stringargs, META_THINGSTRINGARGS); + LUA_PushUserdata(L, mo->thing_stringargs, META_THINGSTRINGARGS); break; default: // extra custom variables in Lua memory lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); @@ -996,12 +996,12 @@ static int mapthing_get(lua_State *L) number = mt->special; else if(fastcmp(field,"args")) { - LUA_PushUserdata(L, mt->args, META_THINGARGS); + LUA_PushUserdata(L, mt->thing_args, META_THINGARGS); return 1; } else if(fastcmp(field,"stringargs")) { - LUA_PushUserdata(L, mt->stringargs, META_THINGSTRINGARGS); + LUA_PushUserdata(L, mt->thing_stringargs, META_THINGSTRINGARGS); return 1; } else if(fastcmp(field,"mobj")) { diff --git a/src/lua_script.c b/src/lua_script.c index ee0a5f5ba..f9e316b50 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -900,8 +900,8 @@ void LUA_InvalidateMapthings(void) for (i = 0; i < nummapthings; i++) { LUA_InvalidateUserdata(&mapthings[i]); - LUA_InvalidateUserdata(mapthings[i].args); - LUA_InvalidateUserdata(mapthings[i].stringargs); + LUA_InvalidateUserdata(mapthings[i].thing_args); + LUA_InvalidateUserdata(mapthings[i].thing_stringargs); } } diff --git a/src/m_cheat.c b/src/m_cheat.c index d555e9b1d..081987198 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -792,8 +792,8 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c mt->options = (mt->z << ZSHIFT) | (UINT16)cv_opflags.value; mt->scale = player->mo->scale; - memset(mt->args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->args)); - memset(mt->stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->stringargs)); + memset(mt->thing_args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->thing_args)); + memset(mt->thing_stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->thing_stringargs)); mt->special = 0; memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args)); memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs)); diff --git a/src/objects/ark-arrow.c b/src/objects/ark-arrow.c index 4784dfb45..c514bc664 100644 --- a/src/objects/ark-arrow.c +++ b/src/objects/ark-arrow.c @@ -16,7 +16,7 @@ void Obj_ArkArrowSpawn(mobj_t *mobj) void Obj_ArkArrowSetup(mobj_t *mobj, mapthing_t *mthing) { const fixed_t oldHeight = mobj->height; - statenum_t stateNum = mobj->info->spawnstate + mthing->args[0]; + statenum_t stateNum = mobj->info->spawnstate + mthing->thing_args[0]; if (stateNum - mobj->info->spawnstate >= ARKARROW_OPTIONS) { diff --git a/src/objects/audience.c b/src/objects/audience.c index a43dbcc94..f1c1a0131 100644 --- a/src/objects/audience.c +++ b/src/objects/audience.c @@ -38,10 +38,10 @@ Obj_AudienceInit // Pick follower if (mthing != NULL) { - if (mthing->stringargs[0] != NULL) + if (mthing->thing_stringargs[0] != NULL) { // From mapthing - char *stringcopy = Z_StrDup(mthing->stringargs[0]); + char *stringcopy = Z_StrDup(mthing->thing_stringargs[0]); char *tok = strtok(stringcopy, " ,"); char *c; // for erasing underscores @@ -141,15 +141,15 @@ Obj_AudienceInit { UINT16 colorpick = SKINCOLOR_NONE; - if (mthing->stringargs[1] != NULL) + if (mthing->thing_stringargs[1] != NULL) { - if (!stricmp("Random", mthing->stringargs[1])) + if (!stricmp("Random", mthing->thing_stringargs[1])) { colorpick = FOLLOWERCOLOR_MATCH; } else { - char *stringcopy = Z_StrDup(mthing->stringargs[1]); + char *stringcopy = Z_StrDup(mthing->thing_stringargs[1]); char *tok = strtok(stringcopy, " "); numref = 0; diff --git a/src/objects/battle-ufo.cpp b/src/objects/battle-ufo.cpp index ea53e2bf8..2ccbb78da 100644 --- a/src/objects/battle-ufo.cpp +++ b/src/objects/battle-ufo.cpp @@ -14,7 +14,7 @@ #define BATTLEUFO_BOB_AMP (4) // UFO bob strength #define BATTLEUFO_BOB_SPEED (TICRATE*2) // UFO bob speed -#define spawner_id(o) ((o)->args[0]) +#define spawner_id(o) ((o)->thing_args[0]) #define ufo_spawner(o) ((o)->target) diff --git a/src/objects/dash-rings.c b/src/objects/dash-rings.c index cf3986abe..527157cb1 100644 --- a/src/objects/dash-rings.c +++ b/src/objects/dash-rings.c @@ -67,10 +67,10 @@ void Obj_RainbowDashRingSpawn(mobj_t *mobj) void Obj_DashRingSetup(mobj_t *mobj, mapthing_t *mthing) { static const UINT8 numColors = sizeof(rainbow_colors) / sizeof(skincolornum_t); - const UINT8 additionalThrust = mthing->args[1]; + const UINT8 additionalThrust = mthing->thing_args[1]; statenum_t ringState, overlayState; - mobj->extravalue1 = mthing->args[0]; + mobj->extravalue1 = mthing->thing_args[0]; mobj->cusval = 4 + additionalThrust; switch (mobj->extravalue1) diff --git a/src/objects/loops.c b/src/objects/loops.c index fab1033e1..21d67c12f 100644 --- a/src/objects/loops.c +++ b/src/objects/loops.c @@ -178,8 +178,8 @@ Obj_InitLoopEndpoint void Obj_InitLoopCenter (mobj_t *center) { - center_max_revolution(center) = center->args[1] * FRACUNIT / 360; - center_set_flip(center, center->args[0]); + center_max_revolution(center) = center->thing_args[1] * FRACUNIT / 360; + center_set_flip(center, center->thing_args[0]); } void diff --git a/src/p_enemy.c b/src/p_enemy.c index 1eec607d0..5f29bf333 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3435,7 +3435,7 @@ static void P_DoBossVictory(mobj_t *mo) } // victory! - P_LinedefExecute(mo->args[3], mo, NULL); + P_LinedefExecute(mo->thing_args[3], mo, NULL); if (stoppedclock && modeattacking) // if you're just time attacking, skip making the capsule appear since you don't need to step on it anyways. return; @@ -3459,7 +3459,7 @@ static void P_DoBossVictory(mobj_t *mo) static void P_DoBossDefaultDeath(mobj_t *mo) { - INT32 bossid = mo->args[0]; + INT32 bossid = mo->thing_args[0]; // Stop exploding and prepare to run. P_SetMobjState(mo, mo->info->xdeathstate); @@ -3504,7 +3504,7 @@ void A_BossDeath(mobj_t *mo) if (LUA_CallAction(A_BOSSDEATH, mo)) return; - P_LinedefExecute(mo->args[2], mo, NULL); + P_LinedefExecute(mo->thing_args[2], mo, NULL); mo->health = 0; // Boss is dead (but not necessarily fleeing...) @@ -4079,8 +4079,8 @@ void A_FishJump(mobj_t *actor) jumpval = locvar1; else { - if (actor->args[0]) - jumpval = actor->args[0]; + if (actor->thing_args[0]) + jumpval = actor->thing_args[0]; else jumpval = 44; } @@ -5089,16 +5089,16 @@ void A_RockSpawn(mobj_t *actor) if (LUA_CallAction(A_ROCKSPAWN, actor)) return; - type = actor->stringargs[0] ? get_number(actor->stringargs[0]) : MT_ROCKCRUMBLE1; + type = actor->thing_stringargs[0] ? get_number(actor->thing_stringargs[0]) : MT_ROCKCRUMBLE1; if (type < MT_NULL || type >= NUMMOBJTYPES) { - CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: Invalid mobj type %s!\n", actor->stringargs[0]); + CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: Invalid mobj type %s!\n", actor->thing_stringargs[0]); return; } - dist = max(actor->args[0] << (FRACBITS - 4), 1); - if (actor->args[2]) + dist = max(actor->thing_args[0] << (FRACBITS - 4), 1); + if (actor->thing_args[2]) dist += P_RandomByte(PR_UNDEFINED) * (FRACUNIT/32); // random oomph mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_FALLINGROCK); @@ -5108,7 +5108,7 @@ void A_RockSpawn(mobj_t *actor) P_InstaThrust(mo, mo->angle, dist); mo->momz = dist; - var1 = actor->args[1]; + var1 = actor->thing_args[1]; A_SetTics(actor); } @@ -5770,7 +5770,7 @@ void A_Boss1Chase(mobj_t *actor) } else { - P_LinedefExecute(actor->args[4], actor, NULL); + P_LinedefExecute(actor->thing_args[4], actor, NULL); P_SetMobjState(actor, actor->info->raisestate); } @@ -6467,7 +6467,7 @@ void A_GuardChase(mobj_t *actor) false, NULL) && speed > 0) // can't be the same check as previous so that P_TryMove gets to happen. { - INT32 direction = actor->args[0]; + INT32 direction = actor->thing_args[0]; switch (direction) { @@ -6734,7 +6734,7 @@ void A_Boss3Path(mobj_t *actor) continue; if (mo2->type != MT_BOSS3WAYPOINT) continue; - if (mapthings[i].args[0] != actor->threshold) + if (mapthings[i].thing_args[0] != actor->threshold) continue; P_SetTarget(&actor->target, mo2); @@ -6908,7 +6908,7 @@ void A_LinedefExecuteFromArg(mobj_t *actor) return; } - tagnum = actor->args[locvar1]; + tagnum = actor->thing_args[locvar1]; CONS_Debug(DBG_GAMELOGIC, "A_LinedefExecuteFromArg: Running mobjtype %d's sector with tag %d\n", actor->type, tagnum); @@ -7927,7 +7927,7 @@ void A_StateRangeByParameter(mobj_t *actor) if (udmf) { - parameter = actor->args[0]; + parameter = actor->thing_args[0]; } else if (actor->spawnpoint != NULL) { @@ -10371,14 +10371,14 @@ void A_FlickyCenter(mobj_t *actor) P_SetTarget(&actor->tracer, flicky); actor->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE|MF_NOCLIPTHING); - if (actor->args[1] & TMFF_AIMLESS) + if (actor->thing_args[1] & TMFF_AIMLESS) actor->flags |= MF_SLIDEME; - if (actor->args[1] & TMFF_STATIONARY) + if (actor->thing_args[1] & TMFF_STATIONARY) actor->flags |= MF_GRENADEBOUNCE; - if (actor->args[1] & TMFF_HOP) + if (actor->thing_args[1] & TMFF_HOP) actor->flags |= MF_NOCLIPTHING; - actor->extravalue1 = actor->args[0] ? abs(actor->args[0])*actor->scale : homeRadius; - actor->extravalue2 = actor->args[2]; + actor->extravalue1 = actor->thing_args[0] ? abs(actor->thing_args[0])*actor->scale : homeRadius; + actor->extravalue2 = actor->thing_args[2]; actor->friction = actor->x; actor->movefactor = actor->y; actor->watertop = actor->z; @@ -11299,7 +11299,7 @@ void A_Boss5FindWaypoint(mobj_t *actor) INT32 locvar1 = var1; boolean avoidcenter; INT32 i; - INT32 bossid = actor->args[0]; + INT32 bossid = actor->thing_args[0]; if (LUA_CallAction(A_BOSS5FINDWAYPOINT, actor)) return; @@ -11326,7 +11326,7 @@ void A_Boss5FindWaypoint(mobj_t *actor) continue; if (mapthings[i].mobj->type != MT_FANGWAYPOINT) continue; - if (!(mapthings[i].args[0])) + if (!(mapthings[i].thing_args[0])) continue; P_SetTarget(&actor->tracer, mapthings[i].mobj); @@ -11355,7 +11355,7 @@ void A_Boss5FindWaypoint(mobj_t *actor) continue; if (actor->tracer == mapthings[i].mobj) // this was your tracer last time continue; - if (mapthings[i].args[0]) + if (mapthings[i].thing_args[0]) { if (avoidcenter) continue; @@ -11410,7 +11410,7 @@ void A_Boss5FindWaypoint(mobj_t *actor) continue; if (actor->tracer == mapthings[i].mobj) // this was your tracer last time continue; - if (mapthings[i].args[0]) + if (mapthings[i].thing_args[0]) { if (avoidcenter) continue; @@ -12682,7 +12682,7 @@ void A_SpawnPterabytes(mobj_t *actor) if (LUA_CallAction(A_SPAWNPTERABYTES, actor)) return; - amount = min(1, actor->args[0]); + amount = min(1, actor->thing_args[0]); interval = FixedAngle(FRACUNIT*360/amount); @@ -13322,11 +13322,11 @@ void A_MayonakaArrow(mobj_t *actor) if (LUA_CallAction(A_MAYONAKAARROW, (actor))) return; - iswarning = (actor->args[0] == TMMA_WARN); // is our object a warning sign? + iswarning = (actor->thing_args[0] == TMMA_WARN); // is our object a warning sign? // "animtimer" is replaced by "extravalue1" here. actor->extravalue1 = ((actor->extravalue1) ? (actor->extravalue1+1) : (P_RandomRange(PR_DECORATION, 0, (iswarning) ? (TICRATE/2) : TICRATE*3))); - flip = ((actor->args[0] == TMMA_FLIP) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign. + flip = ((actor->thing_args[0] == TMMA_FLIP) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign. // special warning behavior: if (iswarning) flip = 6; diff --git a/src/p_inter.c b/src/p_inter.c index eebfa1ddc..dcafd07e7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -629,7 +629,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; case MT_STARPOST: - P_TouchStarPost(special, player, special->args[1]); + P_TouchStarPost(special, player, special->thing_args[1]); return; case MT_BIGTUMBLEWEED: diff --git a/src/p_map.c b/src/p_map.c index 0882f7187..bafc67d2e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -527,7 +527,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) if (object->eflags & MFE_SPRUNG) break; - if (spring->args[1]) + if (spring->thing_args[1]) { if (object->player) { diff --git a/src/p_mobj.c b/src/p_mobj.c index d0654494e..be5b61046 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4436,7 +4436,7 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj) color = SKINCOLOR_GOLD; newRenderFlags |= RF_SEMIBRIGHT; } - else if (mobj->args[3] & TMICM_TIMEATTACK) + else if (mobj->thing_args[3] & TMICM_TIMEATTACK) color = SKINCOLOR_SAPPHIRE; else if (itemType == KITEM_SPB) color = SKINCOLOR_JET; @@ -6539,7 +6539,7 @@ static void P_MobjSceneryThink(mobj_t *mobj) if (!(leveltime % 10)) { mobj_t *smok = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_PETSMOKE); - if (mobj->args[0]) + if (mobj->thing_args[0]) P_SetMobjStateNF(smok, smok->info->painstate); // same function, diff sprite } break; @@ -9736,7 +9736,7 @@ static boolean P_FuseThink(mobj_t *mobj) case MT_SPIKE: case MT_WALLSPIKE: P_SetMobjState(mobj, mobj->state->nextstate); - mobj->fuse = mobj->args[0]; + mobj->fuse = mobj->thing_args[0]; break; case MT_LAVAFALL: if (mobj->state - states == S_LAVAFALL_DORMANT) @@ -9873,7 +9873,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->flags & MF_NOTHINK) return; - if ((mobj->flags & MF_BOSS) && (bossdisabled & (1 << mobj->args[0]))) + if ((mobj->flags & MF_BOSS) && (bossdisabled & (1 << mobj->thing_args[0]))) return; mobj->flags2 &= ~(MF2_ALREADYHIT); @@ -12087,7 +12087,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) // Setting the spawnpoint's args[0] will make the player start on the ceiling // Objectflip inverts - if (!!(mthing->args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP)) + if (!!(mthing->thing_args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP)) z = ceilingspawn - offset; else z = floor + offset; @@ -12098,7 +12098,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) mobj->flags2 |= MF2_OBJECTFLIP; } - if (mthing->args[0]) + if (mthing->thing_args[0]) P_SetPlayerMobjState(mobj, S_KART_SPINOUT); } else @@ -12220,7 +12220,7 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt case MT_YELLOWHORIZ: case MT_REDHORIZ: case MT_BLUEHORIZ: - offset += mthing->args[0] ? 0 : 16*FRACUNIT; + offset += mthing->thing_args[0] ? 0 : 16*FRACUNIT; break; // Ring-like items, float additional units unless args[0] is set. @@ -12228,7 +12228,7 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt case MT_EMBLEM: case MT_RING: case MT_BLUESPHERE: - offset += mthing->args[0] ? 0 : 24*FRACUNIT; + offset += mthing->thing_args[0] ? 0 : 24*FRACUNIT; break; // This object does not have an offset @@ -12447,15 +12447,15 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) mobjeflag_t meflagsapply; const size_t mthingi = (size_t)(mthing - mapthings); - mlength = abs(mthing->args[0]); - mnumspokes = mthing->args[1] + 1; + mlength = abs(mthing->thing_args[0]); + mnumspokes = mthing->thing_args[1] + 1; mspokeangle = FixedAngle((360*FRACUNIT)/mnumspokes) >> ANGLETOFINESHIFT; - mwidth = max(0, mthing->args[2]); - mspeed = abs(mthing->args[3] << 4); - mphase = mthing->args[4] % 360; - mpinch = mthing->args[5] % 360; - mnumnospokes = mthing->args[6]; - mminlength = max(0, min(mlength - 1, mthing->args[7])); + mwidth = max(0, mthing->thing_args[2]); + mspeed = abs(mthing->thing_args[3] << 4); + mphase = mthing->thing_args[4] % 360; + mpinch = mthing->thing_args[5] % 360; + mnumnospokes = mthing->thing_args[6]; + mminlength = max(0, min(mlength - 1, mthing->thing_args[7])); mpitch = mthing->pitch % 360; myaw = mthing->angle % 360; mroll = mthing->roll % 360; @@ -12488,23 +12488,23 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) switch (mobj->type) { case MT_SPRINGBALLPOINT: - macetype = ((mthing->args[8] & TMM_DOUBLESIZE) + macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE) ? MT_REDSPRINGBALL : MT_YELLOWSPRINGBALL); chainlink = MT_SMALLMACECHAIN; break; case MT_FIREBARPOINT: - macetype = ((mthing->args[8] & TMM_DOUBLESIZE) + macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE) ? MT_BIGFIREBAR : MT_SMALLFIREBAR); chainlink = MT_NULL; break; case MT_CUSTOMMACEPOINT: - macetype = mthing->stringargs[0] ? get_number(mthing->stringargs[0]) : MT_NULL; - chainlink = mthing->stringargs[1] ? get_number(mthing->stringargs[1]) : MT_NULL; + macetype = mthing->thing_stringargs[0] ? get_number(mthing->thing_stringargs[0]) : MT_NULL; + chainlink = mthing->thing_stringargs[1] ? get_number(mthing->thing_stringargs[1]) : MT_NULL; break; case MT_CHAINPOINT: - if (mthing->args[8] & TMM_DOUBLESIZE) + if (mthing->thing_args[8] & TMM_DOUBLESIZE) { macetype = MT_BIGGRABCHAIN; chainlink = MT_BIGMACECHAIN; @@ -12517,7 +12517,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) mchainlike = true; break; default: - if (mthing->args[8] & TMM_DOUBLESIZE) + if (mthing->thing_args[8] & TMM_DOUBLESIZE) { macetype = MT_BIGMACE; chainlink = MT_BIGMACECHAIN; @@ -12544,11 +12544,11 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) firsttype = macetype; // Adjustable direction - if (mthing->args[8] & TMM_ALLOWYAWCONTROL) + if (mthing->thing_args[8] & TMM_ALLOWYAWCONTROL) mobj->flags |= MF_SLIDEME; // Swinging - if (mthing->args[8] & TMM_SWING) + if (mthing->thing_args[8] & TMM_SWING) { mobj->flags2 |= MF2_STRONGBOX; mmin = ((mnumnospokes > 1) ? 1 : 0); @@ -12557,11 +12557,11 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) mmin = mnumspokes; // If over distance away, don't move UNLESS this flag is applied - if (mthing->args[8] & TMM_ALWAYSTHINK) + if (mthing->thing_args[8] & TMM_ALWAYSTHINK) mobj->flags2 |= MF2_BOSSNOTRAP; // Make the links the same type as the end - repeated below - if ((mobj->type != MT_CHAINPOINT) && (((mthing->args[8] & TMM_MACELINKS) == TMM_MACELINKS) != (mobj->type == MT_FIREBARPOINT))) // exclusive or + if ((mobj->type != MT_CHAINPOINT) && (((mthing->thing_args[8] & TMM_MACELINKS) == TMM_MACELINKS) != (mobj->type == MT_FIREBARPOINT))) // exclusive or { linktype = macetype; radiusfactor = 2; // Double the radius. @@ -12573,7 +12573,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) mchainlike = (firsttype == chainlink); widthfactor = (mchainlike ? 1 : 2); - mflagsapply = (mthing->args[8] & TMM_CLIP) ? 0 : (MF_NOCLIP|MF_NOCLIPHEIGHT); + mflagsapply = (mthing->thing_args[8] & TMM_CLIP) ? 0 : (MF_NOCLIP|MF_NOCLIPHEIGHT); mflags2apply = ((mthing->options & MTF_OBJECTFLIP) ? MF2_OBJECTFLIP : 0); meflagsapply = ((mthing->options & MTF_OBJECTFLIP) ? MFE_VERTICALFLIP : 0); @@ -12599,14 +12599,14 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) hprev = spawnee;\ } - mdosound = (mspeed && !(mthing->args[8] & TMM_SILENT)); - mdocenter = (macetype && (mthing->args[8] & TMM_CENTERLINK)); + mdosound = (mspeed && !(mthing->thing_args[8] & TMM_SILENT)); + mdocenter = (macetype && (mthing->thing_args[8] & TMM_CENTERLINK)); // The actual spawning of spokes while (mnumspokes-- > 0) { // Offsets - if (mthing->args[8] & TMM_SWING) // Swinging + if (mthing->thing_args[8] & TMM_SWING) // Swinging mroll = (mroll - mspokeangle) & FINEMASK; else // Spinning mphase = (mphase - mspokeangle) & FINEMASK; @@ -12617,7 +12617,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) continue; linktype = chainlink; - firsttype = ((mthing->args[8] & TMM_DOUBLESIZE) ? MT_BIGGRABCHAIN : MT_SMALLGRABCHAIN); + firsttype = ((mthing->thing_args[8] & TMM_DOUBLESIZE) ? MT_BIGGRABCHAIN : MT_SMALLGRABCHAIN); mmaxlength = 1 + (mlength - 1) * radiusfactor; radiusfactor = widthfactor = 1; } @@ -12626,7 +12626,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj) if (mobj->type == MT_CHAINMACEPOINT) { // Make the links the same type as the end - repeated above - if (mthing->args[8] & TMM_MACELINKS) + if (mthing->thing_args[8] & TMM_MACELINKS) { linktype = macetype; radiusfactor = 2; @@ -12716,20 +12716,20 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj) const size_t mthingi = (size_t)(mthing - mapthings); // Find the corresponding linedef special, using args[6] as tag - line = mthing->args[6] ? Tag_FindLineSpecial(15, mthing->args[6]) : -1; + line = mthing->thing_args[6] ? Tag_FindLineSpecial(15, mthing->thing_args[6]) : -1; - type = mthing->stringargs[0] ? get_number(mthing->stringargs[0]) : MT_PARTICLE; + type = mthing->thing_stringargs[0] ? get_number(mthing->thing_stringargs[0]) : MT_PARTICLE; - ticcount = mthing->args[4]; + ticcount = mthing->thing_args[4]; if (ticcount < 1) ticcount = 3; - numdivisions = mthing->args[0]; + numdivisions = mthing->thing_args[0]; if (numdivisions) { - radius = mthing->args[1] << FRACBITS; - anglespeed = (mthing->args[3]) % 360; + radius = mthing->thing_args[1] << FRACBITS; + anglespeed = (mthing->thing_args[3]) % 360; angledivision = 360/numdivisions; } else @@ -12740,11 +12740,11 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj) angledivision = 0; } - speed = abs(mthing->args[2]) << FRACBITS; + speed = abs(mthing->thing_args[2]) << FRACBITS; if (mthing->options & MTF_OBJECTFLIP) speed *= -1; - zdist = abs(mthing->args[5]) << FRACBITS; + zdist = abs(mthing->thing_args[5]) << FRACBITS; CONS_Debug(DBG_GAMELOGIC, "Particle Generator (mapthing #%s):\n" "Radius is %d\n" @@ -12846,7 +12846,7 @@ void P_InitSkyboxPoint(mobj_t *mobj, mapthing_t *mthing) return; } - if (mthing->args[0]) + if (mthing->thing_args[0]) P_SetTarget(&skyboxcenterpnts[tag], mobj); else P_SetTarget(&skyboxviewpnts[tag], mobj); @@ -12901,14 +12901,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) break; } case MT_EGGSTATUE: - if (mthing->args[1]) + if (mthing->thing_args[1]) { mobj->color = SKINCOLOR_GOLD; mobj->colorized = true; } break; case MT_FAN: - if (mthing->args[1] & TMF_INVISIBLE) + if (mthing->thing_args[1] & TMF_INVISIBLE) { P_UnsetThingPosition(mobj); if (sector_list) @@ -12919,21 +12919,21 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) mobj->flags |= MF_NOSECTOR; // this flag basically turns it invisible P_SetThingPosition(mobj); } - if (mthing->args[1] & TMF_NODISTANCECHECK) + if (mthing->thing_args[1] & TMF_NODISTANCECHECK) mobj->flags2 |= MF2_AMBUSH; - if (mthing->args[0]) - mobj->health = mthing->args[0]; + if (mthing->thing_args[0]) + mobj->health = mthing->thing_args[0]; else mobj->health = FixedMul(mobj->subsector->sector->ceilingheight - mobj->subsector->sector->floorheight, 3*(FRACUNIT/4)) >> FRACBITS; break; case MT_BALLOON: - if (mthing->stringargs[0]) - mobj->color = get_number(mthing->stringargs[0]); - if (mthing->args[0]) + if (mthing->thing_stringargs[0]) + mobj->color = get_number(mthing->thing_stringargs[0]); + if (mthing->thing_args[0]) mobj->flags2 |= MF2_AMBUSH; break; case MT_FLAME: - if (mthing->args[0]) + if (mthing->thing_args[0]) { mobj_t *corona = P_MakeSoftwareCorona(mobj, 20); P_SetScale(corona, (corona->destscale = mobj->scale*3)); @@ -12941,12 +12941,12 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } break; case MT_FLAMEHOLDER: - if (!(mthing->args[0] & TMFH_NOFLAME)) // Spawn the fire + if (!(mthing->thing_args[0] & TMFH_NOFLAME)) // Spawn the fire { mobj_t *flame = P_SpawnMobjFromMobj(mobj, 0, 0, mobj->height, MT_FLAME); P_SetTarget(&flame->target, mobj); flame->flags2 |= MF2_BOSSNOTRAP; - if (mthing->args[0] & TMFH_CORONA) + if (mthing->thing_args[0] & TMFH_CORONA) { mobj_t *corona = P_MakeSoftwareCorona(flame, 20); P_SetScale(corona, (corona->destscale = flame->scale*3)); @@ -12956,13 +12956,13 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) break; case MT_CANDLE: case MT_CANDLEPRICKET: - if (mthing->args[0]) + if (mthing->thing_args[0]) P_MakeSoftwareCorona(mobj, ((mobj->type == MT_CANDLE) ? 42 : 176)); break; case MT_JACKO1: case MT_JACKO2: case MT_JACKO3: - if (!(mthing->args[0])) // take the torch out of the crafting recipe + if (!(mthing->thing_args[0])) // take the torch out of the crafting recipe { mobj_t *overlay = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_OVERLAY); P_SetTarget(&overlay->target, mobj); @@ -12970,14 +12970,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } break; case MT_WATERDRIP: - mobj->tics = 3*TICRATE + mthing->args[0]; + mobj->tics = 3*TICRATE + mthing->thing_args[0]; break; case MT_FLAMEJET: case MT_VERTICALFLAMEJET: - mobj->movecount = mthing->args[0]; - mobj->threshold = mthing->args[1]; - mobj->movedir = mthing->args[2]; - if (mthing->args[3]) + mobj->movecount = mthing->thing_args[0]; + mobj->threshold = mthing->thing_args[1]; + mobj->movedir = mthing->thing_args[2]; + if (mthing->thing_args[3]) mobj->flags2 |= MF2_AMBUSH; break; case MT_MACEPOINT: @@ -12995,8 +12995,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) break; case MT_TUBEWAYPOINT: { - UINT8 sequence = mthing->args[0]; - UINT8 id = mthing->args[1]; + UINT8 sequence = mthing->thing_args[0]; + UINT8 id = mthing->thing_args[1]; mobj->health = id; mobj->threshold = sequence; P_AddTubeWaypoint(sequence, id, mobj); @@ -13005,7 +13005,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) case MT_DSZSTALAGMITE: case MT_DSZ2STALAGMITE: case MT_KELP: - if (mthing->args[0]) { // make mobj twice as big as normal + if (mthing->thing_args[0]) { // make mobj twice as big as normal P_SetScale(mobj, 2*mobj->scale); // not 2*FRACUNIT in case of something like the old ERZ3 mode mobj->destscale = mobj->scale; } @@ -13045,8 +13045,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } break; case MT_SMASHINGSPIKEBALL: - if (mthing->args[0] > 0) - mobj->tics += mthing->args[0]; + if (mthing->thing_args[0] > 0) + mobj->tics += mthing->thing_args[0]; break; case MT_BIGFERN: { @@ -13070,37 +13070,37 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) break; case MT_AXIS: // Inverted if args[3] is set - if (mthing->args[3]) + if (mthing->thing_args[3]) mobj->flags2 |= MF2_AMBUSH; - mobj->radius = abs(mthing->args[2]) << FRACBITS; + mobj->radius = abs(mthing->thing_args[2]) << FRACBITS; // FALLTHRU case MT_AXISTRANSFER: case MT_AXISTRANSFERLINE: // Mare it belongs to - mobj->threshold = min(mthing->args[0], 7); + mobj->threshold = min(mthing->thing_args[0], 7); // # in the mare - mobj->health = mthing->args[1]; + mobj->health = mthing->thing_args[1]; mobj->flags2 |= MF2_AXIS; break; case MT_STARPOST: - mobj->health = mthing->args[0] + 1; + mobj->health = mthing->thing_args[0] + 1; if (!P_MapAlreadyHasStarPost(mobj)) numstarposts++; break; case MT_SPIKE: // Pop up spikes! - if (mthing->args[0]) + if (mthing->thing_args[0]) { mobj->flags &= ~MF_SCENERY; - mobj->fuse = mthing->args[1]; + mobj->fuse = mthing->thing_args[1]; } - if (mthing->args[2] & TMSF_RETRACTED) + if (mthing->thing_args[2] & TMSF_RETRACTED) P_SetMobjState(mobj, mobj->info->meleestate); // Use per-thing collision for spikes unless the intangible flag is checked. - if (!(mthing->args[2] & TMSF_INTANGIBLE) && !metalrecording) + if (!(mthing->thing_args[2] & TMSF_INTANGIBLE) && !metalrecording) { P_UnsetThingPosition(mobj); mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT); @@ -13110,15 +13110,15 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) break; case MT_WALLSPIKE: // Pop up spikes! - if (mthing->args[0]) + if (mthing->thing_args[0]) { mobj->flags &= ~MF_SCENERY; - mobj->fuse = mthing->args[1]; + mobj->fuse = mthing->thing_args[1]; } - if (mthing->args[2] & TMSF_RETRACTED) + if (mthing->thing_args[2] & TMSF_RETRACTED) P_SetMobjState(mobj, mobj->info->meleestate); // Use per-thing collision for spikes unless the intangible flag is checked. - if (!(mthing->args[2] & TMSF_INTANGIBLE) && !metalrecording) + if (!(mthing->thing_args[2] & TMSF_INTANGIBLE) && !metalrecording) { P_UnsetThingPosition(mobj); mobj->flags &= ~(MF_NOBLOCKMAP | MF_NOCLIPHEIGHT); @@ -13142,7 +13142,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) break; case MT_BIGTUMBLEWEED: case MT_LITTLETUMBLEWEED: - if (mthing->args[0]) + if (mthing->thing_args[0]) { fixed_t offset = FixedMul(16*FRACUNIT, mobj->scale); mobj->momx += P_RandomChance(PR_DECORATION, FRACUNIT/2) ? offset : -offset; @@ -13152,9 +13152,9 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } break; case MT_AMBIENT: - if (mthing->stringargs[0]) - mobj->threshold = get_number(mthing->stringargs[0]); - mobj->health = mthing->args[0] ? mthing->args[0] : TICRATE; + if (mthing->thing_stringargs[0]) + mobj->threshold = get_number(mthing->thing_stringargs[0]); + mobj->health = mthing->thing_args[0] ? mthing->thing_args[0] : TICRATE; break; // SRB2Kart case MT_WAYPOINT: @@ -13163,8 +13163,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) mapheaderinfo[gamemap-1]->default_waypoint_radius; mtag_t tag = mthing->tid; - if (mthing->args[1] > 0) - mobj->radius = (mthing->args[1]) * FRACUNIT; + if (mthing->thing_args[1] > 0) + mobj->radius = (mthing->thing_args[1]) * FRACUNIT; else if (mobjscale > 0) mobj->radius = mobjscale; else @@ -13176,9 +13176,9 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) // lastlook is used for indicating the waypoint is a shortcut // extravalue1 is used for indicating the waypoint is disabled // extravalue2 is used for indicating the waypoint is the finishline - mobj->threshold = mthing->args[0]; + mobj->threshold = mthing->thing_args[0]; mobj->movecount = tag; - if (mthing->args[2] & TMWPF_DISABLED) + if (mthing->thing_args[2] & TMWPF_DISABLED) { mobj->extravalue1 = 0; // The waypoint is disabled if extra is on } @@ -13186,7 +13186,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) { mobj->extravalue1 = 1; } - if (mthing->args[2] & TMWPF_SHORTCUT) + if (mthing->thing_args[2] & TMWPF_SHORTCUT) { mobj->lastlook = 1; // the waypoint is a shortcut if objectspecial is on } @@ -13194,7 +13194,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) { mobj->lastlook = 0; } - if (mthing->args[2] & TMWPF_NORESPAWN) + if (mthing->thing_args[2] & TMWPF_NORESPAWN) { mobj->reactiontime = 0; // Can't respawn at if Ambush is on } @@ -13202,7 +13202,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) { mobj->reactiontime = 1; } - if (mthing->args[2] & TMWPF_FINISHLINE) + if (mthing->thing_args[2] & TMWPF_FINISHLINE) { mobj->extravalue2 = 1; // args[2] of 1 means the waypoint is at the finish line mobj->reactiontime = 0; // Also don't respawn at finish lines @@ -13222,9 +13222,9 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) case MT_BOTHINT: { // Change size - if (mthing->args[0] > 0) + if (mthing->thing_args[0] > 0) { - mobj->radius = mthing->args[0] * FRACUNIT; + mobj->radius = mthing->thing_args[0] * FRACUNIT; } else { @@ -13232,7 +13232,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } // Steer away instead of towards - if (mthing->args[2]) + if (mthing->thing_args[2]) { mobj->extravalue1 = 0; } @@ -13242,13 +13242,13 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } // Steering amount - if (mthing->args[1] == 0) + if (mthing->thing_args[1] == 0) { mobj->extravalue2 = 4; } else { - mobj->extravalue2 = mthing->args[1]; + mobj->extravalue2 = mthing->thing_args[1]; } break; } @@ -13266,7 +13266,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) P_SetThingPosition(mobj); } } - if (mthing->args[0] == 1) + if (mthing->thing_args[0] == 1) mobj->flags2 |= MF2_AMBUSH; break; } @@ -13289,14 +13289,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) mobj->flags |= MF_NOGRAVITY; // Angle = item type - if (mthing->args[0] > 0 && mthing->args[0] < NUMKARTITEMS) - mobj->threshold = mthing->args[0]; + if (mthing->thing_args[0] > 0 && mthing->thing_args[0] < NUMKARTITEMS) + mobj->threshold = mthing->thing_args[0]; // Parameter = extra items (x5 for rings) - mobj->movecount += mthing->args[1]; + mobj->movecount += mthing->thing_args[1]; // Ambush = double size (grounded) / half size (aerial) - if (!(mthing->args[2] & TMICF_INVERTSIZE) == !P_IsObjectOnGround(mobj)) + if (!(mthing->thing_args[2] & TMICF_INVERTSIZE) == !P_IsObjectOnGround(mobj)) { mobj->extravalue1 = min(mobj->extravalue1 << 1, FixedDiv(MAPBLOCKSIZE, mobj->info->radius)); // don't make them larger than the blockmap can handle mobj->scalespeed <<= 1; @@ -13305,17 +13305,17 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } case MT_RANDOMAUDIENCE: { - if (mthing->args[2] & TMAUDIM_FLOAT) + if (mthing->thing_args[2] & TMAUDIM_FLOAT) { mobj->flags |= MF_NOGRAVITY; } - if (mthing->args[2] & TMAUDIM_BORED) + if (mthing->thing_args[2] & TMAUDIM_BORED) { mobj->flags2 |= MF2_BOSSNOTRAP; } - if (mthing->args[3] != 0) + if (mthing->thing_args[3] != 0) { mobj->flags2 |= MF2_AMBUSH; } @@ -13331,8 +13331,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) { fixed_t top = mobj->z; UINT8 i; - UINT8 locnumsegs = abs(mthing->args[0])+2; - UINT8 numleaves = max(3, (abs(mthing->args[1])+1 % 6) + 3); + UINT8 locnumsegs = abs(mthing->thing_args[0])+2; + UINT8 numleaves = max(3, (abs(mthing->thing_args[1])+1 % 6) + 3); mobj_t *coconut; // Spawn tree segments @@ -13368,7 +13368,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) case MT_SUNBEAMPALM_STEM: { UINT8 i; - const UINT8 numleaves = max(4, (abs(mthing->args[0])+1 % 6) + 4); + const UINT8 numleaves = max(4, (abs(mthing->thing_args[0])+1 % 6) + 4); const fixed_t pivot = P_RandomRange(PR_DECORATION, -40, 20) * FRACUNIT; @@ -13470,7 +13470,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) } // Moving capsules! - if (mthing->args[0] && mthing->args[1]) + if (mthing->thing_args[0] && mthing->thing_args[1]) { K_SetupMovingCapsule(mthing, mobj); } @@ -13539,7 +13539,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) { Obj_DuelBombInit(mobj); - if (mthing->args[1]) + if (mthing->thing_args[1]) { Obj_DuelBombReverse(mobj); } @@ -13597,7 +13597,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) if (mobj->flags & MF_BOSS) { - if (mthing->args[1]) // No egg trap for this boss + if (mthing->thing_args[1]) // No egg trap for this boss mobj->flags2 |= MF2_BOSSNOTRAP; } @@ -13638,32 +13638,32 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, for (arg = 0; arg < NUM_MAPTHING_ARGS; arg++) { - mobj->args[arg] = mthing->args[arg]; + mobj->thing_args[arg] = mthing->thing_args[arg]; } for (arg = 0; arg < NUM_MAPTHING_STRINGARGS; arg++) { size_t len = 0; - if (mthing->stringargs[arg]) + if (mthing->thing_stringargs[arg]) { - len = strlen(mthing->stringargs[arg]); + len = strlen(mthing->thing_stringargs[arg]); } if (len == 0) { - Z_Free(mobj->stringargs[arg]); - mobj->stringargs[arg] = NULL; + Z_Free(mobj->thing_stringargs[arg]); + mobj->thing_stringargs[arg] = NULL; continue; } - mobj->stringargs[arg] = Z_Realloc(mobj->stringargs[arg], len + 1, PU_LEVEL, NULL); - M_Memcpy(mobj->stringargs[arg], mthing->stringargs[arg], len + 1); + mobj->thing_stringargs[arg] = Z_Realloc(mobj->thing_stringargs[arg], len + 1, PU_LEVEL, NULL); + M_Memcpy(mobj->thing_stringargs[arg], mthing->thing_stringargs[arg], len + 1); } for (arg = 0; arg < NUM_SCRIPT_ARGS; arg++) { - mobj->script_args[arg] = mthing->args[arg]; + mobj->script_args[arg] = mthing->script_args[arg]; } for (arg = 0; arg < NUM_SCRIPT_STRINGARGS; arg++) @@ -13756,7 +13756,7 @@ void P_SpawnHoop(mapthing_t *mthing) mobj_t *nextmobj = NULL; mobj_t *hoopcenter; TMatrix *pitchmatrix, *yawmatrix; - fixed_t radius = mthing->args[0] << FRACBITS; + fixed_t radius = mthing->thing_args[0] << FRACBITS; fixed_t sizefactor = 4*FRACUNIT; fixed_t hoopsize = radius/sizefactor; INT32 i; @@ -13908,7 +13908,7 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi loopanchor->spawnpoint = NULL; - Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->args[0]); + Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->thing_args[0]); } for (r = 0; r < numitems; r++) @@ -14064,8 +14064,8 @@ void P_SpawnItemPattern(mapthing_t *mthing) UINT8 numitemtypes; if (!udmf) return; - P_ParseItemTypes(mthing->stringargs[0], itemtypes, &numitemtypes); - P_SpawnItemRow(mthing, itemtypes, numitemtypes, mthing->args[0], mthing->args[1] << FRACBITS, mthing->args[2] << FRACBITS, mthing->angle); + P_ParseItemTypes(mthing->thing_stringargs[0], itemtypes, &numitemtypes); + P_SpawnItemRow(mthing, itemtypes, numitemtypes, mthing->thing_args[0], mthing->thing_args[1] << FRACBITS, mthing->thing_args[2] << FRACBITS, mthing->angle); return; } case 611: // Generic item circle @@ -14074,9 +14074,8 @@ void P_SpawnItemPattern(mapthing_t *mthing) UINT8 numitemtypes; if (!udmf) return; - CONS_Printf("Itemstring: %s\n", mthing->stringargs[0]); - P_ParseItemTypes(mthing->stringargs[0], itemtypes, &numitemtypes); - P_SpawnItemCircle(mthing, itemtypes, numitemtypes, mthing->args[0], mthing->args[1] << FRACBITS); + P_ParseItemTypes(mthing->thing_stringargs[0], itemtypes, &numitemtypes); + P_SpawnItemCircle(mthing, itemtypes, numitemtypes, mthing->thing_args[0], mthing->thing_args[1] << FRACBITS); return; } default: @@ -14739,8 +14738,8 @@ void P_DeleteMobjStringArgs(mobj_t *mobj) for (i = 0; i < NUM_MAPTHING_STRINGARGS; i++) { - Z_Free(mobj->stringargs[i]); - mobj->stringargs[i] = NULL; + Z_Free(mobj->thing_stringargs[i]); + mobj->thing_stringargs[i] = NULL; } for (i = 0; i < NUM_SCRIPT_STRINGARGS; i++) diff --git a/src/p_mobj.h b/src/p_mobj.h index b1ac0004c..0a3fb3939 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -426,8 +426,8 @@ struct mobj_t INT32 dispoffset; - INT32 args[NUM_MAPTHING_ARGS]; - char *stringargs[NUM_MAPTHING_STRINGARGS]; + INT32 thing_args[NUM_MAPTHING_ARGS]; + char *thing_stringargs[NUM_MAPTHING_STRINGARGS]; INT16 special; INT32 script_args[NUM_SCRIPT_ARGS]; diff --git a/src/p_saveg.c b/src/p_saveg.c index 630888763..b171b1091 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2319,7 +2319,7 @@ static boolean P_ThingArgsEqual(const mobj_t *mobj, const mapthing_t *mapthing) { UINT8 i; for (i = 0; i < NUM_MAPTHING_ARGS; i++) - if (mobj->args[i] != mapthing->args[i]) + if (mobj->thing_args[i] != mapthing->thing_args[i]) return false; return true; @@ -2330,10 +2330,10 @@ static boolean P_ThingStringArgsEqual(const mobj_t *mobj, const mapthing_t *mapt UINT8 i; for (i = 0; i < NUM_MAPTHING_STRINGARGS; i++) { - if (!mobj->stringargs[i]) - return !mapthing->stringargs[i]; + if (!mobj->thing_stringargs[i]) + return !mapthing->thing_stringargs[i]; - if (strcmp(mobj->stringargs[i], mapthing->stringargs[i])) + if (strcmp(mobj->thing_stringargs[i], mapthing->thing_stringargs[i])) return false; } @@ -2578,7 +2578,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8 for (j = 0; j < NUM_MAPTHING_ARGS; j++) { - if (mobj->args[j] != 0) + if (mobj->thing_args[j] != 0) { diff |= MD_ARGS; break; @@ -2587,7 +2587,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8 for (j = 0; j < NUM_MAPTHING_STRINGARGS; j++) { - if (mobj->stringargs[j] != NULL) + if (mobj->thing_stringargs[j] != NULL) { diff |= MD_STRINGARGS; break; @@ -2610,7 +2610,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8 for (j = 0; j < NUM_SCRIPT_STRINGARGS; j++) { - if (mobj->stringargs[j] != NULL) + if (mobj->script_stringargs[j] != NULL) { diff2 |= MD2_SPECIAL; break; @@ -2867,7 +2867,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8 if (diff & MD_ARGS) { for (j = 0; j < NUM_MAPTHING_ARGS; j++) - WRITEINT32(save->p, mobj->args[j]); + WRITEINT32(save->p, mobj->thing_args[j]); } if (diff & MD_STRINGARGS) { @@ -2875,16 +2875,16 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8 { size_t len, k; - if (!mobj->stringargs[j]) + if (!mobj->thing_stringargs[j]) { WRITEINT32(save->p, 0); continue; } - len = strlen(mobj->stringargs[j]); + len = strlen(mobj->thing_stringargs[j]); WRITEINT32(save->p, len); for (k = 0; k < len; k++) - WRITECHAR(save->p, mobj->stringargs[j][k]); + WRITECHAR(save->p, mobj->thing_stringargs[j][k]); } } if (diff2 & MD2_CUSVAL) @@ -4091,7 +4091,7 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker) if (diff & MD_ARGS) { for (j = 0; j < NUM_MAPTHING_ARGS; j++) - mobj->args[j] = READINT32(save->p); + mobj->thing_args[j] = READINT32(save->p); } if (diff & MD_STRINGARGS) { @@ -4102,15 +4102,15 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker) if (!len) { - Z_Free(mobj->stringargs[j]); - mobj->stringargs[j] = NULL; + Z_Free(mobj->thing_stringargs[j]); + mobj->thing_stringargs[j] = NULL; continue; } - mobj->stringargs[j] = Z_Realloc(mobj->stringargs[j], len + 1, PU_LEVEL, NULL); + mobj->thing_stringargs[j] = Z_Realloc(mobj->thing_stringargs[j], len + 1, PU_LEVEL, NULL); for (k = 0; k < len; k++) - mobj->stringargs[j][k] = READCHAR(save->p); - mobj->stringargs[j][len] = '\0'; + mobj->thing_stringargs[j][k] = READCHAR(save->p); + mobj->thing_stringargs[j][len] = '\0'; } } if (diff2 & MD2_CUSVAL) diff --git a/src/p_setup.c b/src/p_setup.c index 13a8c81d6..07302c90b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -722,7 +722,7 @@ static int cmp_loopends(const void *a, const void *b) // weighted sorting; tag takes precedence over type return intsign(mt1->tid - mt2->tid) * 2 + - intsign(mt1->args[0] - mt2->args[0]); + intsign(mt1->thing_args[0] - mt2->thing_args[0]); } static void P_SpawnMapThings(boolean spawnemblems) @@ -804,7 +804,7 @@ static void P_SpawnMapThings(boolean spawnemblems) *mt2 = loopends[i]; if (mt1->tid == mt2->tid && - mt1->args[0] == mt2->args[0]) + mt1->thing_args[0] == mt2->thing_args[0]) { P_SpawnItemLine(mt1, mt2); i++; @@ -1362,8 +1362,8 @@ static void P_LoadThings(UINT8 *data) mt->tid = 0; mt->scale = FRACUNIT; mt->spritexscale = mt->spriteyscale = FRACUNIT; - memset(mt->args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->args)); - memset(mt->stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->stringargs)); + memset(mt->thing_args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->thing_args)); + memset(mt->thing_stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->thing_stringargs)); mt->special = 0; memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args)); memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs)); @@ -1954,11 +1954,38 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char * else if (fastcmp(param, "type")) mapthings[i].type = atol(val); else if (fastcmp(param, "scale")) - mapthings[i].spritexscale = mapthings[i].spriteyscale = FLOAT_TO_FIXED(atof(val)); + { + if (udmf_version < 1) + { + mapthings[i].scale = FLOAT_TO_FIXED(atof(val)); + } + else + { + mapthings[i].spritexscale = mapthings[i].spriteyscale = FLOAT_TO_FIXED(atof(val)); + } + } else if (fastcmp(param, "scalex")) - mapthings[i].spritexscale = FLOAT_TO_FIXED(atof(val)); + { + if (udmf_version < 1) + { + mapthings[i].scale = FLOAT_TO_FIXED(atof(val)); + } + else + { + mapthings[i].spritexscale = FLOAT_TO_FIXED(atof(val)); + } + } else if (fastcmp(param, "scaley")) - mapthings[i].spriteyscale = FLOAT_TO_FIXED(atof(val)); + { + if (udmf_version < 1) + { + mapthings[i].scale = FLOAT_TO_FIXED(atof(val)); + } + else + { + mapthings[i].spriteyscale = FLOAT_TO_FIXED(atof(val)); + } + } else if (fastcmp(param, "mobjscale")) mapthings[i].scale = FLOAT_TO_FIXED(atof(val)); // Flags @@ -1969,39 +1996,62 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char * mapthings[i].special = atol(val); else if (fastcmp(param, "foflayer")) mapthings[i].layer = atol(val); - else if (fastncmp(param, "stringthingarg", 9) && strlen(param) > 9) + else if (fastncmp(param, "stringarg", 9) && strlen(param) > 9) { - size_t argnum = atol(param + 9); + if (udmf_version < 1) + { + size_t argnum = atol(param + 9); + if (argnum >= NUM_MAPTHING_STRINGARGS) + return; + size_t len = strlen(val); + mapthings[i].thing_stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL); + M_Memcpy(mapthings[i].thing_stringargs[argnum], val, len); + mapthings[i].thing_stringargs[argnum][len] = '\0'; + } + else + { + size_t argnum = atol(param + 9); + if (argnum >= NUM_SCRIPT_STRINGARGS) + return; + size_t len = strlen(val); + mapthings[i].script_stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL); + M_Memcpy(mapthings[i].script_stringargs[argnum], val, len); + mapthings[i].script_stringargs[argnum][len] = '\0'; + } + } + else if (fastncmp(param, "arg", 3) && strlen(param) > 3) + { + if (udmf_version < 1) + { + size_t argnum = atol(param + 3); + if (argnum >= NUM_MAPTHING_ARGS) + return; + mapthings[i].thing_args[argnum] = atol(val); + } + else + { + size_t argnum = atol(param + 3); + if (argnum >= NUM_SCRIPT_ARGS) + return; + mapthings[i].script_args[argnum] = atol(val); + } + } + else if (fastncmp(param, "thingstringarg", 14) && strlen(param) > 14) + { + size_t argnum = atol(param + 14); if (argnum >= NUM_MAPTHING_STRINGARGS) return; size_t len = strlen(val); - mapthings[i].stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL); - M_Memcpy(mapthings[i].stringargs[argnum], val, len); - mapthings[i].stringargs[argnum][len] = '\0'; + mapthings[i].thing_stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL); + M_Memcpy(mapthings[i].thing_stringargs[argnum], val, len); + mapthings[i].thing_stringargs[argnum][len] = '\0'; } - else if (fastncmp(param, "thingarg", 3) && strlen(param) > 3) + else if (fastncmp(param, "thingarg", 8) && strlen(param) > 8) { - size_t argnum = atol(param + 3); + size_t argnum = atol(param + 8); if (argnum >= NUM_MAPTHING_ARGS) return; - mapthings[i].args[argnum] = atol(val); - } - else if (fastncmp(param, "stringarg", 15) && strlen(param) > 15) - { - size_t argnum = atol(param + 15); - if (argnum >= NUM_SCRIPT_STRINGARGS) - return; - size_t len = strlen(val); - mapthings[i].script_stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL); - M_Memcpy(mapthings[i].script_stringargs[argnum], val, len); - mapthings[i].script_stringargs[argnum][len] = '\0'; - } - else if (fastncmp(param, "arg", 9) && strlen(param) > 9) - { - size_t argnum = atol(param + 9); - if (argnum >= NUM_SCRIPT_ARGS) - return; - mapthings[i].script_args[argnum] = atol(val); + mapthings[i].thing_args[argnum] = atol(val); } else ParseUserProperty(&mapthings[i].user, param, val); @@ -2155,11 +2205,11 @@ static void P_WriteTextmapThing(FILE *f, mapthing_t *wmapthings, size_t i, size_ if (mapthings[i].script_stringargs[j]) fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), mapthings[i].script_stringargs[j]); for (j = 0; j < NUM_MAPTHING_ARGS; j++) - if (wmapthings[i].args[j] != 0) - fprintf(f, "thingarg%s = %d;\n", sizeu1(j), wmapthings[i].args[j]); + if (wmapthings[i].thing_args[j] != 0) + fprintf(f, "thingarg%s = %d;\n", sizeu1(j), wmapthings[i].thing_args[j]); for (j = 0; j < NUM_MAPTHING_STRINGARGS; j++) - if (mapthings[i].stringargs[j]) - fprintf(f, "stringthingarg%s = \"%s\";\n", sizeu1(j), mapthings[i].stringargs[j]); + if (mapthings[i].thing_stringargs[j]) + fprintf(f, "stringthingarg%s = \"%s\";\n", sizeu1(j), mapthings[i].thing_stringargs[j]); if (wmapthings[i].user.length > 0) { for (j = 0; j < wmapthings[i].user.length; j++) @@ -3175,8 +3225,8 @@ static void P_LoadTextmap(void) mt->tid = 0; mt->scale = FRACUNIT; mt->spritexscale = mt->spriteyscale = FRACUNIT; - memset(mt->args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->args)); - memset(mt->stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->stringargs)); + memset(mt->thing_args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->thing_args)); + memset(mt->thing_stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->thing_stringargs)); mt->special = 0; memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args)); memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs)); @@ -6594,45 +6644,45 @@ static void P_ConvertBinaryThingTypes(void) if (mobjinfo[mobjtype].flags & MF_BOSS) { INT32 paramoffset = mapthings[i].extrainfo*LE_PARAMWIDTH; - mapthings[i].args[0] = mapthings[i].extrainfo; - mapthings[i].args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); - mapthings[i].args[2] = LE_BOSSDEAD + paramoffset; - mapthings[i].args[3] = LE_ALLBOSSESDEAD + paramoffset; - mapthings[i].args[4] = LE_PINCHPHASE + paramoffset; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); + mapthings[i].thing_args[2] = LE_BOSSDEAD + paramoffset; + mapthings[i].thing_args[3] = LE_ALLBOSSESDEAD + paramoffset; + mapthings[i].thing_args[4] = LE_PINCHPHASE + paramoffset; } if (mobjinfo[mobjtype].flags & MF_PUSHABLE) { if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_AMBUSH)) == (MTF_OBJECTSPECIAL|MTF_AMBUSH)) - mapthings[i].args[0] = TMP_CLASSIC; + mapthings[i].thing_args[0] = TMP_CLASSIC; else if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[0] = TMP_SLIDE; + mapthings[i].thing_args[0] = TMP_SLIDE; else if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[0] = TMP_IMMOVABLE; + mapthings[i].thing_args[0] = TMP_IMMOVABLE; else - mapthings[i].args[0] = TMP_NORMAL; + mapthings[i].thing_args[0] = TMP_NORMAL; } if (K_IsDuelItem(mobjtype) == true) { - mapthings[i].args[0] = !!(mapthings[i].options & MTF_EXTRA); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_EXTRA); } } if (mapthings[i].type >= 1 && mapthings[i].type <= 35) //Player starts { - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); continue; } else if (mapthings[i].type >= 2200 && mapthings[i].type <= 2217) //Flickies { - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[1] |= TMFF_AIMLESS; + mapthings[i].thing_args[1] |= TMFF_AIMLESS; if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[1] |= TMFF_STATIONARY; + mapthings[i].thing_args[1] |= TMFF_STATIONARY; if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[1] |= TMFF_HOP; + mapthings[i].thing_args[1] |= TMFF_HOP; if (mapthings[i].type == 2207) - mapthings[i].args[2] = mapthings[i].extrainfo; + mapthings[i].thing_args[2] = mapthings[i].extrainfo; continue; } @@ -6640,13 +6690,13 @@ static void P_ConvertBinaryThingTypes(void) { case 102: //SDURF case 1805: //Puma - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; break; case 110: //THZ Turret - mapthings[i].args[0] = LE_TURRET; + mapthings[i].thing_args[0] = LE_TURRET; break; case 111: //Pop-up Turret - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; break; case 103: //Buzz (Gold) case 104: //Buzz (Red) @@ -6658,62 +6708,62 @@ static void P_ConvertBinaryThingTypes(void) case 132: //Cacolantern case 138: //Banpyura case 1602: //Pian - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 119: //Egg Guard if ((mapthings[i].options & (MTF_EXTRA|MTF_OBJECTSPECIAL)) == MTF_OBJECTSPECIAL) - mapthings[i].args[0] = TMGD_LEFT; + mapthings[i].thing_args[0] = TMGD_LEFT; else if ((mapthings[i].options & (MTF_EXTRA|MTF_OBJECTSPECIAL)) == MTF_EXTRA) - mapthings[i].args[0] = TMGD_RIGHT; + mapthings[i].thing_args[0] = TMGD_RIGHT; else - mapthings[i].args[0] = TMGD_BACK; - mapthings[i].args[1] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = TMGD_BACK; + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_AMBUSH); break; case 127: //Hive Elemental - mapthings[i].args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; break; case 135: //Pterabyte Spawner - mapthings[i].args[0] = mapthings[i].extrainfo + 1; + mapthings[i].thing_args[0] = mapthings[i].extrainfo + 1; break; case 136: //Pyre Fly - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 201: //Egg Slimer - mapthings[i].args[5] = !(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[5] = !(mapthings[i].options & MTF_AMBUSH); break; case 203: //Egg Colosseum - mapthings[i].args[5] = LE_BOSS4DROP + mapthings[i].extrainfo * LE_PARAMWIDTH; + mapthings[i].thing_args[5] = LE_BOSS4DROP + mapthings[i].extrainfo * LE_PARAMWIDTH; break; case 204: //Fang - mapthings[i].args[4] = LE_BOSS4DROP + mapthings[i].extrainfo*LE_PARAMWIDTH; + mapthings[i].thing_args[4] = LE_BOSS4DROP + mapthings[i].extrainfo*LE_PARAMWIDTH; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[5] |= TMF_GRAYSCALE; + mapthings[i].thing_args[5] |= TMF_GRAYSCALE; if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[5] |= TMF_SKIPINTRO; + mapthings[i].thing_args[5] |= TMF_SKIPINTRO; break; case 206: //Brak Eggman (Old) - mapthings[i].args[5] = LE_BRAKPLATFORM + mapthings[i].extrainfo*LE_PARAMWIDTH; + mapthings[i].thing_args[5] = LE_BRAKPLATFORM + mapthings[i].extrainfo*LE_PARAMWIDTH; break; case 207: //Metal Sonic (Race) case 2104: //Amy Cameo - mapthings[i].args[0] = !!(mapthings[i].options & MTF_EXTRA); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_EXTRA); break; case 208: //Metal Sonic (Battle) - mapthings[i].args[5] = !!(mapthings[i].options & MTF_EXTRA); + mapthings[i].thing_args[5] = !!(mapthings[i].options & MTF_EXTRA); break; case 209: //Brak Eggman - mapthings[i].args[5] = LE_BRAKVILEATACK + mapthings[i].extrainfo*LE_PARAMWIDTH; + mapthings[i].thing_args[5] = LE_BRAKVILEATACK + mapthings[i].extrainfo*LE_PARAMWIDTH; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[6] |= TMB_NODEATHFLING; + mapthings[i].thing_args[6] |= TMB_NODEATHFLING; if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[6] |= TMB_BARRIER; + mapthings[i].thing_args[6] |= TMB_BARRIER; break; case 292: //Boss waypoint - mapthings[i].args[0] = mapthings[i].angle; - mapthings[i].args[1] = mapthings[i].options & 7; + mapthings[i].thing_args[0] = mapthings[i].angle; + mapthings[i].thing_args[1] = mapthings[i].options & 7; break; case 294: //Fang waypoint - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 300: //Ring case 301: //Bounce ring @@ -6739,13 +6789,13 @@ static void P_ConvertBinaryThingTypes(void) case 521: //Spikeball case 1706: //Blue sphere case 1800: //Coin - mapthings[i].args[0] = !(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !(mapthings[i].options & MTF_AMBUSH); break; case 409: //Extra life monitor - mapthings[i].args[2] = !(mapthings[i].options & (MTF_AMBUSH|MTF_OBJECTSPECIAL)); + mapthings[i].thing_args[2] = !(mapthings[i].options & (MTF_AMBUSH|MTF_OBJECTSPECIAL)); break; case 500: //Air bubble patch - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 502: //Star post if (mapthings[i].extrainfo) @@ -6753,64 +6803,64 @@ static void P_ConvertBinaryThingTypes(void) // For starposts above param 15 (the 16th), add 360 to the angle like before and start parameter from 1 (NOT 0)! // So the 16th starpost is angle=0 param=15, the 17th would be angle=360 param=1. // This seems more intuitive for mappers to use, since most SP maps won't have over 16 consecutive star posts. - mapthings[i].args[0] = mapthings[i].extrainfo + (mapthings[i].angle/360) * 15; + mapthings[i].thing_args[0] = mapthings[i].extrainfo + (mapthings[i].angle/360) * 15; else // Old behavior if Parameter is 0; add 360 to the angle for each consecutive star post. - mapthings[i].args[0] = (mapthings[i].angle/360); - mapthings[i].args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); + mapthings[i].thing_args[0] = (mapthings[i].angle/360); + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); break; case 522: //Wall spike if (mapthings[i].options & MTF_OBJECTSPECIAL) { - mapthings[i].args[0] = mobjinfo[MT_WALLSPIKE].speed + mapthings[i].angle/360; - mapthings[i].args[1] = (16 - mapthings[i].extrainfo) * mapthings[i].args[0]/16; + mapthings[i].thing_args[0] = mobjinfo[MT_WALLSPIKE].speed + mapthings[i].angle/360; + mapthings[i].thing_args[1] = (16 - mapthings[i].extrainfo) * mapthings[i].thing_args[0]/16; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[2] |= TMSF_RETRACTED; + mapthings[i].thing_args[2] |= TMSF_RETRACTED; } if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[2] |= TMSF_INTANGIBLE; + mapthings[i].thing_args[2] |= TMSF_INTANGIBLE; break; case 523: //Spike if (mapthings[i].options & MTF_OBJECTSPECIAL) { - mapthings[i].args[0] = mobjinfo[MT_SPIKE].speed + mapthings[i].angle; - mapthings[i].args[1] = (16 - mapthings[i].extrainfo) * mapthings[i].args[0]/16; + mapthings[i].thing_args[0] = mobjinfo[MT_SPIKE].speed + mapthings[i].angle; + mapthings[i].thing_args[1] = (16 - mapthings[i].extrainfo) * mapthings[i].thing_args[0]/16; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[2] |= TMSF_RETRACTED; + mapthings[i].thing_args[2] |= TMSF_RETRACTED; } if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[2] |= TMSF_INTANGIBLE; + mapthings[i].thing_args[2] |= TMSF_INTANGIBLE; break; case 540: //Fan - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[1] |= TMF_INVISIBLE; + mapthings[i].thing_args[1] |= TMF_INVISIBLE; if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[1] |= TMF_NODISTANCECHECK; + mapthings[i].thing_args[1] |= TMF_NODISTANCECHECK; break; case 541: //Gas jet - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); - mapthings[i].args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); break; case 543: //Balloon if (mapthings[i].angle > 0) { - P_WriteSkincolor(((mapthings[i].angle - 1) % (numskincolors - 1)) + 1, &mapthings[i].stringargs[0]); + P_WriteSkincolor(((mapthings[i].angle - 1) % (numskincolors - 1)) + 1, &mapthings[i].thing_stringargs[0]); } - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 555: //Diagonal yellow spring case 556: //Diagonal red spring case 557: //Diagonal blue spring if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[0] |= TMDS_NOGRAVITY; + mapthings[i].thing_args[0] |= TMDS_NOGRAVITY; if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[0] |= TMDS_ROTATEEXTRA; + mapthings[i].thing_args[0] |= TMDS_ROTATEEXTRA; break; case 558: //Horizontal yellow spring case 559: //Horizontal red spring case 560: //Horizontal blue spring - mapthings[i].args[0] = !(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !(mapthings[i].options & MTF_AMBUSH); break; case 700: //Water ambience A case 701: //Water ambience B @@ -6820,31 +6870,31 @@ static void P_ConvertBinaryThingTypes(void) case 705: //Water ambience F case 706: //Water ambience G case 707: //Water ambience H - mapthings[i].args[0] = 35; - P_WriteSfx(sfx_amwtr1 + mapthings[i].type - 700, &mapthings[i].stringargs[0]); + mapthings[i].thing_args[0] = 35; + P_WriteSfx(sfx_amwtr1 + mapthings[i].type - 700, &mapthings[i].thing_stringargs[0]); mapthings[i].type = 700; break; case 708: //Disco ambience - mapthings[i].args[0] = 512; - P_WriteSfx(sfx_ambint, &mapthings[i].stringargs[0]); + mapthings[i].thing_args[0] = 512; + P_WriteSfx(sfx_ambint, &mapthings[i].thing_stringargs[0]); mapthings[i].type = 700; break; case 709: //Volcano ambience - mapthings[i].args[0] = 220; - P_WriteSfx(sfx_ambin2, &mapthings[i].stringargs[0]); + mapthings[i].thing_args[0] = 220; + P_WriteSfx(sfx_ambin2, &mapthings[i].thing_stringargs[0]); mapthings[i].type = 700; break; case 710: //Machine ambience - mapthings[i].args[0] = 24; - P_WriteSfx(sfx_ambmac, &mapthings[i].stringargs[0]); + mapthings[i].thing_args[0] = 24; + P_WriteSfx(sfx_ambmac, &mapthings[i].thing_stringargs[0]); mapthings[i].type = 700; break; case 750: //Slope vertex - mapthings[i].args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; break; case 753: //Zoom tube waypoint - mapthings[i].args[0] = mapthings[i].angle >> 8; - mapthings[i].args[1] = mapthings[i].angle & 255; + mapthings[i].thing_args[0] = mapthings[i].angle >> 8; + mapthings[i].thing_args[1] = mapthings[i].angle & 255; break; case 754: //Push point case 755: //Pull point @@ -6868,21 +6918,21 @@ static void P_ConvertBinaryThingTypes(void) break; } - mapthings[i].args[0] = mapthings[i].angle; - mapthings[i].args[1] = P_AproxDistance(line->dx >> FRACBITS, line->dy >> FRACBITS); + mapthings[i].thing_args[0] = mapthings[i].angle; + mapthings[i].thing_args[1] = P_AproxDistance(line->dx >> FRACBITS, line->dy >> FRACBITS); if (mapthings[i].type == 755) - mapthings[i].args[1] *= -1; + mapthings[i].thing_args[1] *= -1; if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[2] |= TMPP_NOZFADE; + mapthings[i].thing_args[2] |= TMPP_NOZFADE; if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[2] |= TMPP_PUSHZ; + mapthings[i].thing_args[2] |= TMPP_PUSHZ; if (!(line->flags & ML_NOCLIMB)) - mapthings[i].args[2] |= TMPP_NONEXCLUSIVE; + mapthings[i].thing_args[2] |= TMPP_NONEXCLUSIVE; mapthings[i].type = 754; break; } case 756: //Blast linedef executor - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; break; case 757: //Fan particle generator { @@ -6893,13 +6943,13 @@ static void P_ConvertBinaryThingTypes(void) CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs to be tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(i), mapthings[i].angle); break; } - mapthings[i].args[0] = mapthings[i].z; - mapthings[i].args[1] = R_PointToDist2(lines[j].v1->x, lines[j].v1->y, lines[j].v2->x, lines[j].v2->y) >> FRACBITS; - mapthings[i].args[2] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; - mapthings[i].args[3] = sides[lines[j].sidenum[0]].rowoffset >> FRACBITS; - mapthings[i].args[4] = lines[j].backsector ? sides[lines[j].sidenum[1]].textureoffset >> FRACBITS : 0; - mapthings[i].args[6] = mapthings[i].angle; - P_WriteDuplicateText(lines[j].stringargs[0], &mapthings[i].stringargs[0]); + mapthings[i].thing_args[0] = mapthings[i].z; + mapthings[i].thing_args[1] = R_PointToDist2(lines[j].v1->x, lines[j].v1->y, lines[j].v2->x, lines[j].v2->y) >> FRACBITS; + mapthings[i].thing_args[2] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; + mapthings[i].thing_args[3] = sides[lines[j].sidenum[0]].rowoffset >> FRACBITS; + mapthings[i].thing_args[4] = lines[j].backsector ? sides[lines[j].sidenum[1]].textureoffset >> FRACBITS : 0; + mapthings[i].thing_args[6] = mapthings[i].angle; + P_WriteDuplicateText(lines[j].stringargs[0], &mapthings[i].thing_stringargs[0]); break; } case 762: //PolyObject spawn point (crush) @@ -6923,21 +6973,21 @@ static void P_ConvertBinaryThingTypes(void) break; } case 780: //Skybox - mapthings[i].args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); break; case 799: //Tutorial plant - mapthings[i].args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; break; case 1002: //Dripping water - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; break; case 1007: //Kelp case 1008: //Stalagmite (DSZ1) case 1011: //Stalagmite (DSZ2) - mapthings[i].args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); break; case 1102: //Eggman Statue - mapthings[i].args[1] = !!(mapthings[i].options & MTF_EXTRA); + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_EXTRA); break; case 1104: //Mace spawnpoint case 1105: //Chain with maces spawnpoint @@ -6957,63 +7007,63 @@ static void P_ConvertBinaryThingTypes(void) mapthings[i].angle = lines[j].frontsector->ceilingheight >> FRACBITS; mapthings[i].pitch = lines[j].frontsector->floorheight >> FRACBITS; - mapthings[i].args[0] = lines[j].dx >> FRACBITS; - mapthings[i].args[1] = mapthings[i].extrainfo; - mapthings[i].args[3] = lines[j].dy >> FRACBITS; - mapthings[i].args[4] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; - mapthings[i].args[7] = -sides[lines[j].sidenum[0]].rowoffset >> FRACBITS; + mapthings[i].thing_args[0] = lines[j].dx >> FRACBITS; + mapthings[i].thing_args[1] = mapthings[i].extrainfo; + mapthings[i].thing_args[3] = lines[j].dy >> FRACBITS; + mapthings[i].thing_args[4] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; + mapthings[i].thing_args[7] = -sides[lines[j].sidenum[0]].rowoffset >> FRACBITS; if (lines[j].backsector) { mapthings[i].roll = lines[j].backsector->ceilingheight >> FRACBITS; - mapthings[i].args[2] = sides[lines[j].sidenum[1]].rowoffset >> FRACBITS; - mapthings[i].args[5] = lines[j].backsector->floorheight >> FRACBITS; - mapthings[i].args[6] = sides[lines[j].sidenum[1]].textureoffset >> FRACBITS; + mapthings[i].thing_args[2] = sides[lines[j].sidenum[1]].rowoffset >> FRACBITS; + mapthings[i].thing_args[5] = lines[j].backsector->floorheight >> FRACBITS; + mapthings[i].thing_args[6] = sides[lines[j].sidenum[1]].textureoffset >> FRACBITS; } if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[8] |= TMM_DOUBLESIZE; + mapthings[i].thing_args[8] |= TMM_DOUBLESIZE; if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[8] |= TMM_SILENT; + mapthings[i].thing_args[8] |= TMM_SILENT; if (lines[j].flags & ML_NOCLIMB) - mapthings[i].args[8] |= TMM_ALLOWYAWCONTROL; + mapthings[i].thing_args[8] |= TMM_ALLOWYAWCONTROL; if (lines[j].flags & ML_SKEWTD) - mapthings[i].args[8] |= TMM_SWING; + mapthings[i].thing_args[8] |= TMM_SWING; if (lines[j].flags & ML_NOSKEW) - mapthings[i].args[8] |= TMM_MACELINKS; + mapthings[i].thing_args[8] |= TMM_MACELINKS; if (lines[j].flags & ML_MIDPEG) - mapthings[i].args[8] |= TMM_CENTERLINK; + mapthings[i].thing_args[8] |= TMM_CENTERLINK; if (lines[j].flags & ML_MIDSOLID) - mapthings[i].args[8] |= TMM_CLIP; + mapthings[i].thing_args[8] |= TMM_CLIP; if (lines[j].flags & ML_WRAPMIDTEX) - mapthings[i].args[8] |= TMM_ALWAYSTHINK; + mapthings[i].thing_args[8] |= TMM_ALWAYSTHINK; if (mapthings[i].type == 1110) { - P_WriteDuplicateText(lines[j].stringargs[0], &mapthings[i].stringargs[0]); - P_WriteDuplicateText(lines[j].stringargs[1], &mapthings[i].stringargs[1]); + P_WriteDuplicateText(lines[j].stringargs[0], &mapthings[i].thing_stringargs[0]); + P_WriteDuplicateText(lines[j].stringargs[1], &mapthings[i].thing_stringargs[1]); } break; } case 1101: //Torch case 1119: //Candle case 1120: //Candle pricket - mapthings[i].args[0] = !!(mapthings[i].options & MTF_EXTRA); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_EXTRA); break; case 1121: //Flame holder if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[0] |= TMFH_NOFLAME; + mapthings[i].thing_args[0] |= TMFH_NOFLAME; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[0] |= TMFH_CORONA; + mapthings[i].thing_args[0] |= TMFH_CORONA; break; case 1127: //Spectator EggRobo if (mapthings[i].options & MTF_AMBUSH) - mapthings[i].args[0] = TMED_LEFT; + mapthings[i].thing_args[0] = TMED_LEFT; else if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[0] = TMED_RIGHT; + mapthings[i].thing_args[0] = TMED_RIGHT; else - mapthings[i].args[0] = TMED_NONE; + mapthings[i].thing_args[0] = TMED_NONE; break; case 1200: //Tumbleweed (Big) case 1201: //Tumbleweed (Small) - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1202: //Rock spawner { @@ -7026,73 +7076,73 @@ static void P_ConvertBinaryThingTypes(void) break; } mapthings[i].angle = AngleFixed(R_PointToAngle2(lines[j].v2->x, lines[j].v2->y, lines[j].v1->x, lines[j].v1->y)) >> FRACBITS; - mapthings[i].args[0] = P_AproxDistance(lines[j].dx, lines[j].dy) >> FRACBITS; - mapthings[i].args[1] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; - mapthings[i].args[2] = !!(lines[j].flags & ML_NOCLIMB); + mapthings[i].thing_args[0] = P_AproxDistance(lines[j].dx, lines[j].dy) >> FRACBITS; + mapthings[i].thing_args[1] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; + mapthings[i].thing_args[2] = !!(lines[j].flags & ML_NOCLIMB); INT32 id = (sides[lines[j].sidenum[0]].rowoffset >> FRACBITS); // Rather than introduce deh_tables.h as a dependency for literally one // conversion, we just... recreate the string expected to be produced. if (id > 0 && id < 16) - P_WriteDuplicateText(va("MT_ROCKCRUMBLE%d", id+1), &mapthings[i].stringargs[0]); + P_WriteDuplicateText(va("MT_ROCKCRUMBLE%d", id+1), &mapthings[i].thing_stringargs[0]); break; } case 1221: //Minecart saloon door - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1229: //Minecart switch point - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1300: //Flame jet (horizontal) case 1301: //Flame jet (vertical) - mapthings[i].args[0] = (mapthings[i].angle >> 13)*TICRATE/2; - mapthings[i].args[1] = ((mapthings[i].angle >> 10) & 7)*TICRATE/2; - mapthings[i].args[2] = 80 - 5*mapthings[i].extrainfo; - mapthings[i].args[3] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = (mapthings[i].angle >> 13)*TICRATE/2; + mapthings[i].thing_args[1] = ((mapthings[i].angle >> 10) & 7)*TICRATE/2; + mapthings[i].thing_args[2] = 80 - 5*mapthings[i].extrainfo; + mapthings[i].thing_args[3] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1304: //Lavafall - mapthings[i].args[0] = mapthings[i].angle; - mapthings[i].args[1] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = mapthings[i].angle; + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1305: //Rollout Rock - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1488: // Follower Audience (unfortunately numbered) if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[2] |= TMAUDIM_FLOAT; + mapthings[i].thing_args[2] |= TMAUDIM_FLOAT; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[2] |= TMAUDIM_BORED; + mapthings[i].thing_args[2] |= TMAUDIM_BORED; - mapthings[i].args[3] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[3] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1500: //Glaregoyle case 1501: //Glaregoyle (Up) case 1502: //Glaregoyle (Down) case 1503: //Glaregoyle (Long) if (mapthings[i].angle >= 360) - mapthings[i].args[1] = 7*(mapthings[i].angle/360) + 1; + mapthings[i].thing_args[1] = 7*(mapthings[i].angle/360) + 1; break; case 1700: //Axis - mapthings[i].args[2] = mapthings[i].angle & 16383; - mapthings[i].args[3] = !!(mapthings[i].angle & 16384); + mapthings[i].thing_args[2] = mapthings[i].angle & 16383; + mapthings[i].thing_args[3] = !!(mapthings[i].angle & 16384); /* FALLTHRU */ case 1701: //Axis transfer case 1702: //Axis transfer line - mapthings[i].args[0] = mapthings[i].extrainfo; - mapthings[i].args[1] = mapthings[i].options; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[1] = mapthings[i].options; break; case 1703: //Ideya drone - mapthings[i].args[0] = mapthings[i].angle & 0xFFF; - mapthings[i].args[1] = mapthings[i].extrainfo*32; - mapthings[i].args[2] = ((mapthings[i].angle & 0xF000) >> 12)*32; + mapthings[i].thing_args[0] = mapthings[i].angle & 0xFFF; + mapthings[i].thing_args[1] = mapthings[i].extrainfo*32; + mapthings[i].thing_args[2] = ((mapthings[i].angle & 0xF000) >> 12)*32; if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_EXTRA)) == (MTF_OBJECTSPECIAL|MTF_EXTRA)) - mapthings[i].args[3] = TMDA_BOTTOM; + mapthings[i].thing_args[3] = TMDA_BOTTOM; else if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_EXTRA)) == MTF_OBJECTSPECIAL) - mapthings[i].args[3] = TMDA_TOP; + mapthings[i].thing_args[3] = TMDA_TOP; else if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_EXTRA)) == MTF_EXTRA) - mapthings[i].args[3] = TMDA_MIDDLE; + mapthings[i].thing_args[3] = TMDA_MIDDLE; else - mapthings[i].args[3] = TMDA_BOTTOMOFFSET; - mapthings[i].args[4] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[3] = TMDA_BOTTOMOFFSET; + mapthings[i].thing_args[4] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1704: //NiGHTS bumper mapthings[i].pitch = 30 * (((mapthings[i].options & 15) + 9) % 12); @@ -7104,31 +7154,31 @@ static void P_ConvertBinaryThingTypes(void) UINT16 oldangle = mapthings[i].angle; mapthings[i].angle = ((oldangle >> 8)*360)/256; mapthings[i].pitch = ((oldangle & 255)*360)/256; - mapthings[i].args[0] = (mapthings[i].type == 1705) ? 96 : (mapthings[i].options & 0xF)*16 + 32; + mapthings[i].thing_args[0] = (mapthings[i].type == 1705) ? 96 : (mapthings[i].options & 0xF)*16 + 32; mapthings[i].options &= ~0xF; mapthings[i].type = 1713; break; } case 1710: //Ideya capture - mapthings[i].args[0] = mapthings[i].extrainfo; - mapthings[i].args[1] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[1] = mapthings[i].angle; break; case 1714: //Ideya anchor point - mapthings[i].args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; break; case 1806: //King Bowser - mapthings[i].args[0] = LE_KOOPA; + mapthings[i].thing_args[0] = LE_KOOPA; break; case 1807: //Axe - mapthings[i].args[0] = LE_AXE; + mapthings[i].thing_args[0] = LE_AXE; break; case 2000: //Smashing spikeball - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; break; case 2006: //Jack-o'-lantern 1 case 2007: //Jack-o'-lantern 2 case 2008: //Jack-o'-lantern 3 - mapthings[i].args[0] = !!(mapthings[i].options & MTF_EXTRA); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_EXTRA); break; case 2001: // MT_WAYPOINT { @@ -7136,7 +7186,7 @@ static void P_ConvertBinaryThingTypes(void) mapthings[i].tid = mapthings[i].angle; - mapthings[i].args[0] = mapthings[i].z; + mapthings[i].thing_args[0] = mapthings[i].z; mapthings[i].z = 0; if (firstline != -1) @@ -7145,106 +7195,106 @@ static void P_ConvertBinaryThingTypes(void) fixed_t linez = sides[lines[firstline].sidenum[0]].rowoffset; if (lineradius > 0) - mapthings[i].args[1] = lineradius / FRACUNIT; + mapthings[i].thing_args[1] = lineradius / FRACUNIT; mapthings[i].z = linez / FRACUNIT; } if (mapthings[i].extrainfo == 1) { - mapthings[i].args[2] |= TMWPF_FINISHLINE; + mapthings[i].thing_args[2] |= TMWPF_FINISHLINE; } if (mapthings[i].options & MTF_EXTRA) { - mapthings[i].args[2] |= TMWPF_DISABLED; + mapthings[i].thing_args[2] |= TMWPF_DISABLED; } if (mapthings[i].options & MTF_OBJECTSPECIAL) { - mapthings[i].args[2] |= TMWPF_SHORTCUT; + mapthings[i].thing_args[2] |= TMWPF_SHORTCUT; } if (mapthings[i].options & MTF_AMBUSH) { - mapthings[i].args[2] |= TMWPF_NORESPAWN; + mapthings[i].thing_args[2] |= TMWPF_NORESPAWN; } break; } case 2004: // MT_BOTHINT - mapthings[i].args[0] = mapthings[i].angle; - mapthings[i].args[1] = mapthings[i].extrainfo; - mapthings[i].args[2] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[0] = mapthings[i].angle; + mapthings[i].thing_args[1] = mapthings[i].extrainfo; + mapthings[i].thing_args[2] = !!(mapthings[i].options & MTF_AMBUSH); break; case 2010: // MT_ITEMCAPSULE - mapthings[i].args[0] = mapthings[i].angle; - mapthings[i].args[1] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].angle; + mapthings[i].thing_args[1] = mapthings[i].extrainfo; if (mapthings[i].options & MTF_OBJECTSPECIAL) { // Special = +16 items (+80 for rings) - mapthings[i].args[1] += 16; + mapthings[i].thing_args[1] += 16; } if (mapthings[i].options & MTF_EXTRA) { // was advertised as an "invert time attack" flag, actually was an "all gamemodes" flag - mapthings[i].args[3] = TMICM_MULTIPLAYER|TMICM_TIMEATTACK; + mapthings[i].thing_args[3] = TMICM_MULTIPLAYER|TMICM_TIMEATTACK; } else { - mapthings[i].args[3] = TMICM_DEFAULT; + mapthings[i].thing_args[3] = TMICM_DEFAULT; } if (mapthings[i].options & MTF_AMBUSH) { - mapthings[i].args[2] |= TMICF_INVERTSIZE; + mapthings[i].thing_args[2] |= TMICF_INVERTSIZE; } break; case 2020: // MT_LOOPENDPOINT { - mapthings[i].args[0] = + mapthings[i].thing_args[0] = mapthings[i].options & MTF_AMBUSH ? TMLOOP_BETA : TMLOOP_ALPHA; break; } case 2021: // MT_LOOPCENTERPOINT - mapthings[i].args[0] = (mapthings[i].options & MTF_AMBUSH) == MTF_AMBUSH; - mapthings[i].args[1] = mapthings[i].angle; + mapthings[i].thing_args[0] = (mapthings[i].options & MTF_AMBUSH) == MTF_AMBUSH; + mapthings[i].thing_args[1] = mapthings[i].angle; break; case 2050: // MT_DUELBOMB - mapthings[i].args[1] = !!(mapthings[i].options & MTF_AMBUSH); + mapthings[i].thing_args[1] = !!(mapthings[i].options & MTF_AMBUSH); break; case 1950: // MT_AAZTREE_HELPER - mapthings[i].args[0] = mapthings[i].extrainfo; - mapthings[i].args[1] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[1] = mapthings[i].angle; break; case 2333: // MT_BATTLECAPSULE - mapthings[i].args[0] = mapthings[i].extrainfo; - mapthings[i].args[1] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[1] = mapthings[i].angle; if (mapthings[i].options & MTF_OBJECTSPECIAL) { - mapthings[i].args[2] |= TMBCF_REVERSE; + mapthings[i].thing_args[2] |= TMBCF_REVERSE; } if (mapthings[i].options & MTF_AMBUSH) { - mapthings[i].args[2] |= TMBCF_BACKANDFORTH; + mapthings[i].thing_args[2] |= TMBCF_BACKANDFORTH; } break; case 3122: // MT_MAYONAKAARROW if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[0] = TMMA_WARN; + mapthings[i].thing_args[0] = TMMA_WARN; else if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[0] = TMMA_FLIP; + mapthings[i].thing_args[0] = TMMA_FLIP; break; case 2018: // MT_PETSMOKER - mapthings[i].args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); + mapthings[i].thing_args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL); break; case 3786: // MT_BATTLEUFO_SPAWNER - mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].thing_args[0] = mapthings[i].angle; break; case 3400: // MT_WATERPALACETURBINE (TODO: not yet hardcoded) { @@ -7266,55 +7316,55 @@ static void P_ConvertBinaryThingTypes(void) mapthings[i].angle = sides[lines[j].sidenum[0]].rowoffset >> FRACBITS; if (mapthings[i].options & MTF_EXTRA) - mapthings[i].args[0] = 1; + mapthings[i].thing_args[0] = 1; if (mapthings[i].options & MTF_OBJECTSPECIAL) - mapthings[i].args[1] = 1; + mapthings[i].thing_args[1] = 1; - mapthings[i].args[2] = lines[j].frontsector->floorheight >> FRACBITS; - mapthings[i].args[3] = lines[j].frontsector->ceilingheight >> FRACBITS; + mapthings[i].thing_args[2] = lines[j].frontsector->floorheight >> FRACBITS; + mapthings[i].thing_args[3] = lines[j].frontsector->ceilingheight >> FRACBITS; - mapthings[i].args[4] = lines[j].backsector->floorheight >> FRACBITS; + mapthings[i].thing_args[4] = lines[j].backsector->floorheight >> FRACBITS; - mapthings[i].args[5] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; - if (mapthings[i].args[5] < 0) - mapthings[i].args[5] = -mapthings[i].args[5]; + mapthings[i].thing_args[5] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS; + if (mapthings[i].thing_args[5] < 0) + mapthings[i].thing_args[5] = -mapthings[i].thing_args[5]; - mapthings[i].args[6] = sides[lines[j].sidenum[1]].rowoffset >> FRACBITS; - if (mapthings[i].args[6] < 0) - mapthings[i].args[6] = -mapthings[i].args[6]; + mapthings[i].thing_args[6] = sides[lines[j].sidenum[1]].rowoffset >> FRACBITS; + if (mapthings[i].thing_args[6] < 0) + mapthings[i].thing_args[6] = -mapthings[i].thing_args[6]; - mapthings[i].args[7] = sides[lines[j].sidenum[1]].textureoffset >> FRACBITS; - if (mapthings[i].args[7] < 0) - mapthings[i].args[7] = -mapthings[i].args[7]; + mapthings[i].thing_args[7] = sides[lines[j].sidenum[1]].textureoffset >> FRACBITS; + if (mapthings[i].thing_args[7] < 0) + mapthings[i].thing_args[7] = -mapthings[i].thing_args[7]; if (lines[j].flags & ML_SKEWTD) - mapthings[i].args[8] = R_PointToDist2(lines[j].v2->x, lines[j].v2->y, lines[j].v1->x, lines[j].v1->y) >> FRACBITS; + mapthings[i].thing_args[8] = R_PointToDist2(lines[j].v2->x, lines[j].v2->y, lines[j].v1->x, lines[j].v1->y) >> FRACBITS; if (lines[j].flags & ML_NOSKEW) - mapthings[i].args[9] = 1; + mapthings[i].thing_args[9] = 1; break; } case 3441: // MT_DASHRING (TODO: not yet hardcoded) case 3442: // MT_RAINBOWDASHRING (TODO: not yet hardcoded) - mapthings[i].args[0] = mapthings[i].options & 13; - mapthings[i].args[1] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].options & 13; + mapthings[i].thing_args[1] = mapthings[i].extrainfo; break; case FLOOR_SLOPE_THING: case CEILING_SLOPE_THING: - mapthings[i].args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; break; case 4094: // MT_ARKARROW - mapthings[i].args[0] = mapthings[i].extrainfo; + mapthings[i].thing_args[0] = mapthings[i].extrainfo; if (mapthings[i].options & MTF_OBJECTSPECIAL) { // Special = add 16 to the symbol type - mapthings[i].args[0] += 16; + mapthings[i].thing_args[0] += 16; } if (mapthings[i].options & MTF_AMBUSH) { // Ambush = add 32 to the symbol type - mapthings[i].args[0] += 32; + mapthings[i].thing_args[0] += 32; } break; default: @@ -7452,43 +7502,6 @@ static boolean P_LoadMapFromFile(void) if (!udmf) P_ConvertBinaryMap(); - if (udmf_version < 1) - { - // version 0 is both binary & older versionless UDMF maps - for (i = 0; i < nummapthings; i++) - { - size_t j; - - mapthings[i].scale = max(mapthings[i].spritexscale, mapthings[i].spriteyscale); - mapthings[i].spritexscale = mapthings[i].spriteyscale = FRACUNIT; - - for (j = 0; j < min(NUM_MAPTHING_ARGS, NUM_SCRIPT_ARGS); j++) - { - mapthings[i].args[j] = mapthings[i].script_args[j]; - } - - for (j = 0; j < min(NUM_MAPTHING_STRINGARGS, NUM_SCRIPT_STRINGARGS); j++) - { - size_t len = 0; - - if (mapthings[i].script_stringargs[j]) - { - len = strlen(mapthings[i].script_stringargs[j]); - } - - if (len == 0) - { - Z_Free(mapthings[i].stringargs[j]); - mapthings[i].stringargs[j] = NULL; - continue; - } - - mapthings[i].stringargs[j] = Z_Realloc(mapthings[i].stringargs[j], len + 1, PU_LEVEL, NULL); - M_Memcpy(mapthings[i].stringargs[j], mapthings[i].script_stringargs[j], len + 1); - } - } - } - if (M_CheckParm("-writetextmap")) P_WriteTextmap(); diff --git a/src/p_slopes.c b/src/p_slopes.c index d8cbee616..771cdbc1c 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -640,7 +640,7 @@ static pslope_t *MakeViaMapthings(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag vx[i].x = mt->x << FRACBITS; vx[i].y = mt->y << FRACBITS; vx[i].z = mt->z << FRACBITS; - if (!mt->args[0]) + if (!mt->thing_args[0]) vx[i].z += R_PointInSubsector(vx[i].x, vx[i].y)->sector->floorheight; } diff --git a/src/slope_anchors.c b/src/slope_anchors.c index f5bbdccdb..05eebce7d 100644 --- a/src/slope_anchors.c +++ b/src/slope_anchors.c @@ -199,7 +199,7 @@ get_anchor for (i = 0; i < list->count; ++i) { - if (list->points[i] == v && list->anchors[i]->args[0] == group) + if (list->points[i] == v && list->anchors[i]->thing_args[0] == group) { for (k = 0; k < 3; ++k) {