Final thing args code cleanup

- Fix the last few bugs I could find with thing args
- Move version update code
- Rename internal variables to `thing_[string]args` to make older code merge issues more obvious
This commit is contained in:
Sally Coolatta 2023-08-22 02:14:09 -04:00
parent 013d149151
commit f02e6dbe3c
22 changed files with 499 additions and 487 deletions

View file

@ -271,9 +271,9 @@ struct mapthing_t
mtag_t tid; mtag_t tid;
fixed_t scale; fixed_t scale;
fixed_t spritexscale, spriteyscale; fixed_t spritexscale, spriteyscale;
INT32 thing_args[NUM_MAPTHING_ARGS];
char *thing_stringargs[NUM_MAPTHING_STRINGARGS];
INT16 special; INT16 special;
INT32 args[NUM_MAPTHING_ARGS];
char *stringargs[NUM_MAPTHING_STRINGARGS];
INT32 script_args[NUM_SCRIPT_ARGS]; INT32 script_args[NUM_SCRIPT_ARGS];
char *script_stringargs[NUM_SCRIPT_STRINGARGS]; char *script_stringargs[NUM_SCRIPT_STRINGARGS];
UINT8 layer; // FOF layer to spawn on, see P_GetMobjSpawnHeight UINT8 layer; // FOF layer to spawn on, see P_GetMobjSpawnHeight

View file

@ -3760,7 +3760,7 @@ void G_AddGhost(savebuffer_t *buffer, char *defdemoname)
gh->mo->angle = FixedAngle(mthing->angle << FRACBITS); gh->mo->angle = FixedAngle(mthing->angle << FRACBITS);
f = gh->mo->floorz; f = gh->mo->floorz;
c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height; 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; z = c - offset;
if (z < f) if (z < f)

View file

@ -712,10 +712,10 @@ void K_RunBattleOvertime(void)
void K_SetupMovingCapsule(mapthing_t *mt, mobj_t *mobj) void K_SetupMovingCapsule(mapthing_t *mt, mobj_t *mobj)
{ {
UINT8 sequence = mt->args[0] - 1; UINT8 sequence = mt->thing_args[0] - 1;
fixed_t speed = (FRACUNIT >> 3) * mt->args[1]; fixed_t speed = (FRACUNIT >> 3) * mt->thing_args[1];
boolean backandforth = (mt->args[2] & TMBCF_BACKANDFORTH); boolean backandforth = (mt->thing_args[2] & TMBCF_BACKANDFORTH);
boolean reverse = (mt->args[2] & TMBCF_REVERSE); boolean reverse = (mt->thing_args[2] & TMBCF_REVERSE);
mobj_t *target = NULL; mobj_t *target = NULL;
// Find the inital target // Find the inital target

View file

@ -77,7 +77,7 @@ boolean K_IsDuelItem(mobjtype_t type)
boolean K_DuelItemAlwaysSpawns(mapthing_t *mt) boolean K_DuelItemAlwaysSpawns(mapthing_t *mt)
{ {
return !!(mt->args[0]); return !!(mt->thing_args[0]);
} }
static void K_SpawnDuelOnlyItems(void) static void K_SpawnDuelOnlyItems(void)
@ -122,14 +122,14 @@ static void K_SpawnItemCapsules(void)
continue; 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))) if (isRingCapsule == true && ((gametyperules & GTR_SPHERES) || (modeattacking & ATTACKING_SPB)))
{ {
// don't spawn ring capsules in ringless gametypes // don't spawn ring capsules in ringless gametypes
continue; continue;
} }
modeFlags = mt->args[3]; modeFlags = mt->thing_args[3];
if (modeFlags == TMICM_DEFAULT) if (modeFlags == TMICM_DEFAULT)
{ {
if (isRingCapsule == true) if (isRingCapsule == true)

View file

@ -2399,7 +2399,7 @@ static boolean K_AnchorWaypointRadius(
anchor->x, anchor->y); anchor->x, anchor->y);
// Keep changes for -writetextmap // Keep changes for -writetextmap
waypointmobj->spawnpoint->args[1] = waypointmobj->radius >> FRACBITS; waypointmobj->spawnpoint->thing_args[1] = waypointmobj->radius >> FRACBITS;
return true; return true;
} }
else else

View file

@ -488,10 +488,10 @@ static int mobj_get(lua_State *L)
lua_pushinteger(L, mo->special); lua_pushinteger(L, mo->special);
break; break;
case mobj_args: case mobj_args:
LUA_PushUserdata(L, mo->args, META_THINGARGS); LUA_PushUserdata(L, mo->thing_args, META_THINGARGS);
break; break;
case mobj_stringargs: case mobj_stringargs:
LUA_PushUserdata(L, mo->stringargs, META_THINGSTRINGARGS); LUA_PushUserdata(L, mo->thing_stringargs, META_THINGSTRINGARGS);
break; break;
default: // extra custom variables in Lua memory default: // extra custom variables in Lua memory
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
@ -996,12 +996,12 @@ static int mapthing_get(lua_State *L)
number = mt->special; number = mt->special;
else if(fastcmp(field,"args")) else if(fastcmp(field,"args"))
{ {
LUA_PushUserdata(L, mt->args, META_THINGARGS); LUA_PushUserdata(L, mt->thing_args, META_THINGARGS);
return 1; return 1;
} }
else if(fastcmp(field,"stringargs")) else if(fastcmp(field,"stringargs"))
{ {
LUA_PushUserdata(L, mt->stringargs, META_THINGSTRINGARGS); LUA_PushUserdata(L, mt->thing_stringargs, META_THINGSTRINGARGS);
return 1; return 1;
} }
else if(fastcmp(field,"mobj")) { else if(fastcmp(field,"mobj")) {

View file

@ -900,8 +900,8 @@ void LUA_InvalidateMapthings(void)
for (i = 0; i < nummapthings; i++) for (i = 0; i < nummapthings; i++)
{ {
LUA_InvalidateUserdata(&mapthings[i]); LUA_InvalidateUserdata(&mapthings[i]);
LUA_InvalidateUserdata(mapthings[i].args); LUA_InvalidateUserdata(mapthings[i].thing_args);
LUA_InvalidateUserdata(mapthings[i].stringargs); LUA_InvalidateUserdata(mapthings[i].thing_stringargs);
} }
} }

View file

@ -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->options = (mt->z << ZSHIFT) | (UINT16)cv_opflags.value;
mt->scale = player->mo->scale; mt->scale = player->mo->scale;
memset(mt->args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->args)); memset(mt->thing_args, 0, NUM_MAPTHING_ARGS*sizeof(*mt->thing_args));
memset(mt->stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->stringargs)); memset(mt->thing_stringargs, 0x00, NUM_MAPTHING_STRINGARGS*sizeof(*mt->thing_stringargs));
mt->special = 0; mt->special = 0;
memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args)); memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args));
memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs)); memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs));

View file

@ -16,7 +16,7 @@ void Obj_ArkArrowSpawn(mobj_t *mobj)
void Obj_ArkArrowSetup(mobj_t *mobj, mapthing_t *mthing) void Obj_ArkArrowSetup(mobj_t *mobj, mapthing_t *mthing)
{ {
const fixed_t oldHeight = mobj->height; 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) if (stateNum - mobj->info->spawnstate >= ARKARROW_OPTIONS)
{ {

View file

@ -38,10 +38,10 @@ Obj_AudienceInit
// Pick follower // Pick follower
if (mthing != NULL) if (mthing != NULL)
{ {
if (mthing->stringargs[0] != NULL) if (mthing->thing_stringargs[0] != NULL)
{ {
// From mapthing // From mapthing
char *stringcopy = Z_StrDup(mthing->stringargs[0]); char *stringcopy = Z_StrDup(mthing->thing_stringargs[0]);
char *tok = strtok(stringcopy, " ,"); char *tok = strtok(stringcopy, " ,");
char *c; // for erasing underscores char *c; // for erasing underscores
@ -141,15 +141,15 @@ Obj_AudienceInit
{ {
UINT16 colorpick = SKINCOLOR_NONE; 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; colorpick = FOLLOWERCOLOR_MATCH;
} }
else else
{ {
char *stringcopy = Z_StrDup(mthing->stringargs[1]); char *stringcopy = Z_StrDup(mthing->thing_stringargs[1]);
char *tok = strtok(stringcopy, " "); char *tok = strtok(stringcopy, " ");
numref = 0; numref = 0;

View file

@ -14,7 +14,7 @@
#define BATTLEUFO_BOB_AMP (4) // UFO bob strength #define BATTLEUFO_BOB_AMP (4) // UFO bob strength
#define BATTLEUFO_BOB_SPEED (TICRATE*2) // UFO bob speed #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) #define ufo_spawner(o) ((o)->target)

View file

@ -67,10 +67,10 @@ void Obj_RainbowDashRingSpawn(mobj_t *mobj)
void Obj_DashRingSetup(mobj_t *mobj, mapthing_t *mthing) void Obj_DashRingSetup(mobj_t *mobj, mapthing_t *mthing)
{ {
static const UINT8 numColors = sizeof(rainbow_colors) / sizeof(skincolornum_t); 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; statenum_t ringState, overlayState;
mobj->extravalue1 = mthing->args[0]; mobj->extravalue1 = mthing->thing_args[0];
mobj->cusval = 4 + additionalThrust; mobj->cusval = 4 + additionalThrust;
switch (mobj->extravalue1) switch (mobj->extravalue1)

View file

@ -178,8 +178,8 @@ Obj_InitLoopEndpoint
void void
Obj_InitLoopCenter (mobj_t *center) Obj_InitLoopCenter (mobj_t *center)
{ {
center_max_revolution(center) = center->args[1] * FRACUNIT / 360; center_max_revolution(center) = center->thing_args[1] * FRACUNIT / 360;
center_set_flip(center, center->args[0]); center_set_flip(center, center->thing_args[0]);
} }
void void

View file

@ -3435,7 +3435,7 @@ static void P_DoBossVictory(mobj_t *mo)
} }
// victory! // 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. 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; return;
@ -3459,7 +3459,7 @@ static void P_DoBossVictory(mobj_t *mo)
static void P_DoBossDefaultDeath(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. // Stop exploding and prepare to run.
P_SetMobjState(mo, mo->info->xdeathstate); P_SetMobjState(mo, mo->info->xdeathstate);
@ -3504,7 +3504,7 @@ void A_BossDeath(mobj_t *mo)
if (LUA_CallAction(A_BOSSDEATH, mo)) if (LUA_CallAction(A_BOSSDEATH, mo))
return; return;
P_LinedefExecute(mo->args[2], mo, NULL); P_LinedefExecute(mo->thing_args[2], mo, NULL);
mo->health = 0; mo->health = 0;
// Boss is dead (but not necessarily fleeing...) // Boss is dead (but not necessarily fleeing...)
@ -4079,8 +4079,8 @@ void A_FishJump(mobj_t *actor)
jumpval = locvar1; jumpval = locvar1;
else else
{ {
if (actor->args[0]) if (actor->thing_args[0])
jumpval = actor->args[0]; jumpval = actor->thing_args[0];
else else
jumpval = 44; jumpval = 44;
} }
@ -5089,16 +5089,16 @@ void A_RockSpawn(mobj_t *actor)
if (LUA_CallAction(A_ROCKSPAWN, actor)) if (LUA_CallAction(A_ROCKSPAWN, actor))
return; 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) 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; return;
} }
dist = max(actor->args[0] << (FRACBITS - 4), 1); dist = max(actor->thing_args[0] << (FRACBITS - 4), 1);
if (actor->args[2]) if (actor->thing_args[2])
dist += P_RandomByte(PR_UNDEFINED) * (FRACUNIT/32); // random oomph dist += P_RandomByte(PR_UNDEFINED) * (FRACUNIT/32); // random oomph
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_FALLINGROCK); 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); P_InstaThrust(mo, mo->angle, dist);
mo->momz = dist; mo->momz = dist;
var1 = actor->args[1]; var1 = actor->thing_args[1];
A_SetTics(actor); A_SetTics(actor);
} }
@ -5770,7 +5770,7 @@ void A_Boss1Chase(mobj_t *actor)
} }
else else
{ {
P_LinedefExecute(actor->args[4], actor, NULL); P_LinedefExecute(actor->thing_args[4], actor, NULL);
P_SetMobjState(actor, actor->info->raisestate); P_SetMobjState(actor, actor->info->raisestate);
} }
@ -6467,7 +6467,7 @@ void A_GuardChase(mobj_t *actor)
false, NULL) false, NULL)
&& speed > 0) // can't be the same check as previous so that P_TryMove gets to happen. && 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) switch (direction)
{ {
@ -6734,7 +6734,7 @@ void A_Boss3Path(mobj_t *actor)
continue; continue;
if (mo2->type != MT_BOSS3WAYPOINT) if (mo2->type != MT_BOSS3WAYPOINT)
continue; continue;
if (mapthings[i].args[0] != actor->threshold) if (mapthings[i].thing_args[0] != actor->threshold)
continue; continue;
P_SetTarget(&actor->target, mo2); P_SetTarget(&actor->target, mo2);
@ -6908,7 +6908,7 @@ void A_LinedefExecuteFromArg(mobj_t *actor)
return; 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); 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) if (udmf)
{ {
parameter = actor->args[0]; parameter = actor->thing_args[0];
} }
else if (actor->spawnpoint != NULL) else if (actor->spawnpoint != NULL)
{ {
@ -10371,14 +10371,14 @@ void A_FlickyCenter(mobj_t *actor)
P_SetTarget(&actor->tracer, flicky); P_SetTarget(&actor->tracer, flicky);
actor->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE|MF_NOCLIPTHING); 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; actor->flags |= MF_SLIDEME;
if (actor->args[1] & TMFF_STATIONARY) if (actor->thing_args[1] & TMFF_STATIONARY)
actor->flags |= MF_GRENADEBOUNCE; actor->flags |= MF_GRENADEBOUNCE;
if (actor->args[1] & TMFF_HOP) if (actor->thing_args[1] & TMFF_HOP)
actor->flags |= MF_NOCLIPTHING; actor->flags |= MF_NOCLIPTHING;
actor->extravalue1 = actor->args[0] ? abs(actor->args[0])*actor->scale : homeRadius; actor->extravalue1 = actor->thing_args[0] ? abs(actor->thing_args[0])*actor->scale : homeRadius;
actor->extravalue2 = actor->args[2]; actor->extravalue2 = actor->thing_args[2];
actor->friction = actor->x; actor->friction = actor->x;
actor->movefactor = actor->y; actor->movefactor = actor->y;
actor->watertop = actor->z; actor->watertop = actor->z;
@ -11299,7 +11299,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
INT32 locvar1 = var1; INT32 locvar1 = var1;
boolean avoidcenter; boolean avoidcenter;
INT32 i; INT32 i;
INT32 bossid = actor->args[0]; INT32 bossid = actor->thing_args[0];
if (LUA_CallAction(A_BOSS5FINDWAYPOINT, actor)) if (LUA_CallAction(A_BOSS5FINDWAYPOINT, actor))
return; return;
@ -11326,7 +11326,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue; continue;
if (mapthings[i].mobj->type != MT_FANGWAYPOINT) if (mapthings[i].mobj->type != MT_FANGWAYPOINT)
continue; continue;
if (!(mapthings[i].args[0])) if (!(mapthings[i].thing_args[0]))
continue; continue;
P_SetTarget(&actor->tracer, mapthings[i].mobj); P_SetTarget(&actor->tracer, mapthings[i].mobj);
@ -11355,7 +11355,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue; continue;
if (actor->tracer == mapthings[i].mobj) // this was your tracer last time if (actor->tracer == mapthings[i].mobj) // this was your tracer last time
continue; continue;
if (mapthings[i].args[0]) if (mapthings[i].thing_args[0])
{ {
if (avoidcenter) if (avoidcenter)
continue; continue;
@ -11410,7 +11410,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue; continue;
if (actor->tracer == mapthings[i].mobj) // this was your tracer last time if (actor->tracer == mapthings[i].mobj) // this was your tracer last time
continue; continue;
if (mapthings[i].args[0]) if (mapthings[i].thing_args[0])
{ {
if (avoidcenter) if (avoidcenter)
continue; continue;
@ -12682,7 +12682,7 @@ void A_SpawnPterabytes(mobj_t *actor)
if (LUA_CallAction(A_SPAWNPTERABYTES, actor)) if (LUA_CallAction(A_SPAWNPTERABYTES, actor))
return; return;
amount = min(1, actor->args[0]); amount = min(1, actor->thing_args[0]);
interval = FixedAngle(FRACUNIT*360/amount); interval = FixedAngle(FRACUNIT*360/amount);
@ -13322,11 +13322,11 @@ void A_MayonakaArrow(mobj_t *actor)
if (LUA_CallAction(A_MAYONAKAARROW, (actor))) if (LUA_CallAction(A_MAYONAKAARROW, (actor)))
return; 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. // "animtimer" is replaced by "extravalue1" here.
actor->extravalue1 = ((actor->extravalue1) ? (actor->extravalue1+1) : (P_RandomRange(PR_DECORATION, 0, (iswarning) ? (TICRATE/2) : TICRATE*3))); 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: // special warning behavior:
if (iswarning) if (iswarning)
flip = 6; flip = 6;

View file

@ -629,7 +629,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return; return;
case MT_STARPOST: case MT_STARPOST:
P_TouchStarPost(special, player, special->args[1]); P_TouchStarPost(special, player, special->thing_args[1]);
return; return;
case MT_BIGTUMBLEWEED: case MT_BIGTUMBLEWEED:

View file

@ -527,7 +527,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
if (object->eflags & MFE_SPRUNG) if (object->eflags & MFE_SPRUNG)
break; break;
if (spring->args[1]) if (spring->thing_args[1])
{ {
if (object->player) if (object->player)
{ {

View file

@ -4436,7 +4436,7 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj)
color = SKINCOLOR_GOLD; color = SKINCOLOR_GOLD;
newRenderFlags |= RF_SEMIBRIGHT; newRenderFlags |= RF_SEMIBRIGHT;
} }
else if (mobj->args[3] & TMICM_TIMEATTACK) else if (mobj->thing_args[3] & TMICM_TIMEATTACK)
color = SKINCOLOR_SAPPHIRE; color = SKINCOLOR_SAPPHIRE;
else if (itemType == KITEM_SPB) else if (itemType == KITEM_SPB)
color = SKINCOLOR_JET; color = SKINCOLOR_JET;
@ -6539,7 +6539,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
if (!(leveltime % 10)) if (!(leveltime % 10))
{ {
mobj_t *smok = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_PETSMOKE); 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 P_SetMobjStateNF(smok, smok->info->painstate); // same function, diff sprite
} }
break; break;
@ -9736,7 +9736,7 @@ static boolean P_FuseThink(mobj_t *mobj)
case MT_SPIKE: case MT_SPIKE:
case MT_WALLSPIKE: case MT_WALLSPIKE:
P_SetMobjState(mobj, mobj->state->nextstate); P_SetMobjState(mobj, mobj->state->nextstate);
mobj->fuse = mobj->args[0]; mobj->fuse = mobj->thing_args[0];
break; break;
case MT_LAVAFALL: case MT_LAVAFALL:
if (mobj->state - states == S_LAVAFALL_DORMANT) if (mobj->state - states == S_LAVAFALL_DORMANT)
@ -9873,7 +9873,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags & MF_NOTHINK) if (mobj->flags & MF_NOTHINK)
return; return;
if ((mobj->flags & MF_BOSS) && (bossdisabled & (1 << mobj->args[0]))) if ((mobj->flags & MF_BOSS) && (bossdisabled & (1 << mobj->thing_args[0])))
return; return;
mobj->flags2 &= ~(MF2_ALREADYHIT); 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 // Setting the spawnpoint's args[0] will make the player start on the ceiling
// Objectflip inverts // Objectflip inverts
if (!!(mthing->args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP)) if (!!(mthing->thing_args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP))
z = ceilingspawn - offset; z = ceilingspawn - offset;
else else
z = floor + offset; z = floor + offset;
@ -12098,7 +12098,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
mobj->flags2 |= MF2_OBJECTFLIP; mobj->flags2 |= MF2_OBJECTFLIP;
} }
if (mthing->args[0]) if (mthing->thing_args[0])
P_SetPlayerMobjState(mobj, S_KART_SPINOUT); P_SetPlayerMobjState(mobj, S_KART_SPINOUT);
} }
else else
@ -12220,7 +12220,7 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt
case MT_YELLOWHORIZ: case MT_YELLOWHORIZ:
case MT_REDHORIZ: case MT_REDHORIZ:
case MT_BLUEHORIZ: case MT_BLUEHORIZ:
offset += mthing->args[0] ? 0 : 16*FRACUNIT; offset += mthing->thing_args[0] ? 0 : 16*FRACUNIT;
break; break;
// Ring-like items, float additional units unless args[0] is set. // 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_EMBLEM:
case MT_RING: case MT_RING:
case MT_BLUESPHERE: case MT_BLUESPHERE:
offset += mthing->args[0] ? 0 : 24*FRACUNIT; offset += mthing->thing_args[0] ? 0 : 24*FRACUNIT;
break; break;
// This object does not have an offset // This object does not have an offset
@ -12447,15 +12447,15 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
mobjeflag_t meflagsapply; mobjeflag_t meflagsapply;
const size_t mthingi = (size_t)(mthing - mapthings); const size_t mthingi = (size_t)(mthing - mapthings);
mlength = abs(mthing->args[0]); mlength = abs(mthing->thing_args[0]);
mnumspokes = mthing->args[1] + 1; mnumspokes = mthing->thing_args[1] + 1;
mspokeangle = FixedAngle((360*FRACUNIT)/mnumspokes) >> ANGLETOFINESHIFT; mspokeangle = FixedAngle((360*FRACUNIT)/mnumspokes) >> ANGLETOFINESHIFT;
mwidth = max(0, mthing->args[2]); mwidth = max(0, mthing->thing_args[2]);
mspeed = abs(mthing->args[3] << 4); mspeed = abs(mthing->thing_args[3] << 4);
mphase = mthing->args[4] % 360; mphase = mthing->thing_args[4] % 360;
mpinch = mthing->args[5] % 360; mpinch = mthing->thing_args[5] % 360;
mnumnospokes = mthing->args[6]; mnumnospokes = mthing->thing_args[6];
mminlength = max(0, min(mlength - 1, mthing->args[7])); mminlength = max(0, min(mlength - 1, mthing->thing_args[7]));
mpitch = mthing->pitch % 360; mpitch = mthing->pitch % 360;
myaw = mthing->angle % 360; myaw = mthing->angle % 360;
mroll = mthing->roll % 360; mroll = mthing->roll % 360;
@ -12488,23 +12488,23 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
switch (mobj->type) switch (mobj->type)
{ {
case MT_SPRINGBALLPOINT: case MT_SPRINGBALLPOINT:
macetype = ((mthing->args[8] & TMM_DOUBLESIZE) macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE)
? MT_REDSPRINGBALL ? MT_REDSPRINGBALL
: MT_YELLOWSPRINGBALL); : MT_YELLOWSPRINGBALL);
chainlink = MT_SMALLMACECHAIN; chainlink = MT_SMALLMACECHAIN;
break; break;
case MT_FIREBARPOINT: case MT_FIREBARPOINT:
macetype = ((mthing->args[8] & TMM_DOUBLESIZE) macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE)
? MT_BIGFIREBAR ? MT_BIGFIREBAR
: MT_SMALLFIREBAR); : MT_SMALLFIREBAR);
chainlink = MT_NULL; chainlink = MT_NULL;
break; break;
case MT_CUSTOMMACEPOINT: case MT_CUSTOMMACEPOINT:
macetype = mthing->stringargs[0] ? get_number(mthing->stringargs[0]) : MT_NULL; macetype = mthing->thing_stringargs[0] ? get_number(mthing->thing_stringargs[0]) : MT_NULL;
chainlink = mthing->stringargs[1] ? get_number(mthing->stringargs[1]) : MT_NULL; chainlink = mthing->thing_stringargs[1] ? get_number(mthing->thing_stringargs[1]) : MT_NULL;
break; break;
case MT_CHAINPOINT: case MT_CHAINPOINT:
if (mthing->args[8] & TMM_DOUBLESIZE) if (mthing->thing_args[8] & TMM_DOUBLESIZE)
{ {
macetype = MT_BIGGRABCHAIN; macetype = MT_BIGGRABCHAIN;
chainlink = MT_BIGMACECHAIN; chainlink = MT_BIGMACECHAIN;
@ -12517,7 +12517,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
mchainlike = true; mchainlike = true;
break; break;
default: default:
if (mthing->args[8] & TMM_DOUBLESIZE) if (mthing->thing_args[8] & TMM_DOUBLESIZE)
{ {
macetype = MT_BIGMACE; macetype = MT_BIGMACE;
chainlink = MT_BIGMACECHAIN; chainlink = MT_BIGMACECHAIN;
@ -12544,11 +12544,11 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
firsttype = macetype; firsttype = macetype;
// Adjustable direction // Adjustable direction
if (mthing->args[8] & TMM_ALLOWYAWCONTROL) if (mthing->thing_args[8] & TMM_ALLOWYAWCONTROL)
mobj->flags |= MF_SLIDEME; mobj->flags |= MF_SLIDEME;
// Swinging // Swinging
if (mthing->args[8] & TMM_SWING) if (mthing->thing_args[8] & TMM_SWING)
{ {
mobj->flags2 |= MF2_STRONGBOX; mobj->flags2 |= MF2_STRONGBOX;
mmin = ((mnumnospokes > 1) ? 1 : 0); mmin = ((mnumnospokes > 1) ? 1 : 0);
@ -12557,11 +12557,11 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
mmin = mnumspokes; mmin = mnumspokes;
// If over distance away, don't move UNLESS this flag is applied // 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; mobj->flags2 |= MF2_BOSSNOTRAP;
// Make the links the same type as the end - repeated below // 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; linktype = macetype;
radiusfactor = 2; // Double the radius. radiusfactor = 2; // Double the radius.
@ -12573,7 +12573,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
mchainlike = (firsttype == chainlink); mchainlike = (firsttype == chainlink);
widthfactor = (mchainlike ? 1 : 2); 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); mflags2apply = ((mthing->options & MTF_OBJECTFLIP) ? MF2_OBJECTFLIP : 0);
meflagsapply = ((mthing->options & MTF_OBJECTFLIP) ? MFE_VERTICALFLIP : 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;\ hprev = spawnee;\
} }
mdosound = (mspeed && !(mthing->args[8] & TMM_SILENT)); mdosound = (mspeed && !(mthing->thing_args[8] & TMM_SILENT));
mdocenter = (macetype && (mthing->args[8] & TMM_CENTERLINK)); mdocenter = (macetype && (mthing->thing_args[8] & TMM_CENTERLINK));
// The actual spawning of spokes // The actual spawning of spokes
while (mnumspokes-- > 0) while (mnumspokes-- > 0)
{ {
// Offsets // Offsets
if (mthing->args[8] & TMM_SWING) // Swinging if (mthing->thing_args[8] & TMM_SWING) // Swinging
mroll = (mroll - mspokeangle) & FINEMASK; mroll = (mroll - mspokeangle) & FINEMASK;
else // Spinning else // Spinning
mphase = (mphase - mspokeangle) & FINEMASK; mphase = (mphase - mspokeangle) & FINEMASK;
@ -12617,7 +12617,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
continue; continue;
linktype = chainlink; 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; mmaxlength = 1 + (mlength - 1) * radiusfactor;
radiusfactor = widthfactor = 1; radiusfactor = widthfactor = 1;
} }
@ -12626,7 +12626,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
if (mobj->type == MT_CHAINMACEPOINT) if (mobj->type == MT_CHAINMACEPOINT)
{ {
// Make the links the same type as the end - repeated above // 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; linktype = macetype;
radiusfactor = 2; radiusfactor = 2;
@ -12716,20 +12716,20 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj)
const size_t mthingi = (size_t)(mthing - mapthings); const size_t mthingi = (size_t)(mthing - mapthings);
// Find the corresponding linedef special, using args[6] as tag // 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) if (ticcount < 1)
ticcount = 3; ticcount = 3;
numdivisions = mthing->args[0]; numdivisions = mthing->thing_args[0];
if (numdivisions) if (numdivisions)
{ {
radius = mthing->args[1] << FRACBITS; radius = mthing->thing_args[1] << FRACBITS;
anglespeed = (mthing->args[3]) % 360; anglespeed = (mthing->thing_args[3]) % 360;
angledivision = 360/numdivisions; angledivision = 360/numdivisions;
} }
else else
@ -12740,11 +12740,11 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj)
angledivision = 0; angledivision = 0;
} }
speed = abs(mthing->args[2]) << FRACBITS; speed = abs(mthing->thing_args[2]) << FRACBITS;
if (mthing->options & MTF_OBJECTFLIP) if (mthing->options & MTF_OBJECTFLIP)
speed *= -1; speed *= -1;
zdist = abs(mthing->args[5]) << FRACBITS; zdist = abs(mthing->thing_args[5]) << FRACBITS;
CONS_Debug(DBG_GAMELOGIC, "Particle Generator (mapthing #%s):\n" CONS_Debug(DBG_GAMELOGIC, "Particle Generator (mapthing #%s):\n"
"Radius is %d\n" "Radius is %d\n"
@ -12846,7 +12846,7 @@ void P_InitSkyboxPoint(mobj_t *mobj, mapthing_t *mthing)
return; return;
} }
if (mthing->args[0]) if (mthing->thing_args[0])
P_SetTarget(&skyboxcenterpnts[tag], mobj); P_SetTarget(&skyboxcenterpnts[tag], mobj);
else else
P_SetTarget(&skyboxviewpnts[tag], mobj); P_SetTarget(&skyboxviewpnts[tag], mobj);
@ -12901,14 +12901,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break; break;
} }
case MT_EGGSTATUE: case MT_EGGSTATUE:
if (mthing->args[1]) if (mthing->thing_args[1])
{ {
mobj->color = SKINCOLOR_GOLD; mobj->color = SKINCOLOR_GOLD;
mobj->colorized = true; mobj->colorized = true;
} }
break; break;
case MT_FAN: case MT_FAN:
if (mthing->args[1] & TMF_INVISIBLE) if (mthing->thing_args[1] & TMF_INVISIBLE)
{ {
P_UnsetThingPosition(mobj); P_UnsetThingPosition(mobj);
if (sector_list) 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 mobj->flags |= MF_NOSECTOR; // this flag basically turns it invisible
P_SetThingPosition(mobj); P_SetThingPosition(mobj);
} }
if (mthing->args[1] & TMF_NODISTANCECHECK) if (mthing->thing_args[1] & TMF_NODISTANCECHECK)
mobj->flags2 |= MF2_AMBUSH; mobj->flags2 |= MF2_AMBUSH;
if (mthing->args[0]) if (mthing->thing_args[0])
mobj->health = mthing->args[0]; mobj->health = mthing->thing_args[0];
else else
mobj->health = FixedMul(mobj->subsector->sector->ceilingheight - mobj->subsector->sector->floorheight, 3*(FRACUNIT/4)) >> FRACBITS; mobj->health = FixedMul(mobj->subsector->sector->ceilingheight - mobj->subsector->sector->floorheight, 3*(FRACUNIT/4)) >> FRACBITS;
break; break;
case MT_BALLOON: case MT_BALLOON:
if (mthing->stringargs[0]) if (mthing->thing_stringargs[0])
mobj->color = get_number(mthing->stringargs[0]); mobj->color = get_number(mthing->thing_stringargs[0]);
if (mthing->args[0]) if (mthing->thing_args[0])
mobj->flags2 |= MF2_AMBUSH; mobj->flags2 |= MF2_AMBUSH;
break; break;
case MT_FLAME: case MT_FLAME:
if (mthing->args[0]) if (mthing->thing_args[0])
{ {
mobj_t *corona = P_MakeSoftwareCorona(mobj, 20); mobj_t *corona = P_MakeSoftwareCorona(mobj, 20);
P_SetScale(corona, (corona->destscale = mobj->scale*3)); P_SetScale(corona, (corona->destscale = mobj->scale*3));
@ -12941,12 +12941,12 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
} }
break; break;
case MT_FLAMEHOLDER: 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); mobj_t *flame = P_SpawnMobjFromMobj(mobj, 0, 0, mobj->height, MT_FLAME);
P_SetTarget(&flame->target, mobj); P_SetTarget(&flame->target, mobj);
flame->flags2 |= MF2_BOSSNOTRAP; flame->flags2 |= MF2_BOSSNOTRAP;
if (mthing->args[0] & TMFH_CORONA) if (mthing->thing_args[0] & TMFH_CORONA)
{ {
mobj_t *corona = P_MakeSoftwareCorona(flame, 20); mobj_t *corona = P_MakeSoftwareCorona(flame, 20);
P_SetScale(corona, (corona->destscale = flame->scale*3)); P_SetScale(corona, (corona->destscale = flame->scale*3));
@ -12956,13 +12956,13 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break; break;
case MT_CANDLE: case MT_CANDLE:
case MT_CANDLEPRICKET: case MT_CANDLEPRICKET:
if (mthing->args[0]) if (mthing->thing_args[0])
P_MakeSoftwareCorona(mobj, ((mobj->type == MT_CANDLE) ? 42 : 176)); P_MakeSoftwareCorona(mobj, ((mobj->type == MT_CANDLE) ? 42 : 176));
break; break;
case MT_JACKO1: case MT_JACKO1:
case MT_JACKO2: case MT_JACKO2:
case MT_JACKO3: 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); mobj_t *overlay = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_OVERLAY);
P_SetTarget(&overlay->target, mobj); P_SetTarget(&overlay->target, mobj);
@ -12970,14 +12970,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
} }
break; break;
case MT_WATERDRIP: case MT_WATERDRIP:
mobj->tics = 3*TICRATE + mthing->args[0]; mobj->tics = 3*TICRATE + mthing->thing_args[0];
break; break;
case MT_FLAMEJET: case MT_FLAMEJET:
case MT_VERTICALFLAMEJET: case MT_VERTICALFLAMEJET:
mobj->movecount = mthing->args[0]; mobj->movecount = mthing->thing_args[0];
mobj->threshold = mthing->args[1]; mobj->threshold = mthing->thing_args[1];
mobj->movedir = mthing->args[2]; mobj->movedir = mthing->thing_args[2];
if (mthing->args[3]) if (mthing->thing_args[3])
mobj->flags2 |= MF2_AMBUSH; mobj->flags2 |= MF2_AMBUSH;
break; break;
case MT_MACEPOINT: case MT_MACEPOINT:
@ -12995,8 +12995,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break; break;
case MT_TUBEWAYPOINT: case MT_TUBEWAYPOINT:
{ {
UINT8 sequence = mthing->args[0]; UINT8 sequence = mthing->thing_args[0];
UINT8 id = mthing->args[1]; UINT8 id = mthing->thing_args[1];
mobj->health = id; mobj->health = id;
mobj->threshold = sequence; mobj->threshold = sequence;
P_AddTubeWaypoint(sequence, id, mobj); P_AddTubeWaypoint(sequence, id, mobj);
@ -13005,7 +13005,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
case MT_DSZSTALAGMITE: case MT_DSZSTALAGMITE:
case MT_DSZ2STALAGMITE: case MT_DSZ2STALAGMITE:
case MT_KELP: 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 P_SetScale(mobj, 2*mobj->scale); // not 2*FRACUNIT in case of something like the old ERZ3 mode
mobj->destscale = mobj->scale; mobj->destscale = mobj->scale;
} }
@ -13045,8 +13045,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
} }
break; break;
case MT_SMASHINGSPIKEBALL: case MT_SMASHINGSPIKEBALL:
if (mthing->args[0] > 0) if (mthing->thing_args[0] > 0)
mobj->tics += mthing->args[0]; mobj->tics += mthing->thing_args[0];
break; break;
case MT_BIGFERN: case MT_BIGFERN:
{ {
@ -13070,37 +13070,37 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break; break;
case MT_AXIS: case MT_AXIS:
// Inverted if args[3] is set // Inverted if args[3] is set
if (mthing->args[3]) if (mthing->thing_args[3])
mobj->flags2 |= MF2_AMBUSH; mobj->flags2 |= MF2_AMBUSH;
mobj->radius = abs(mthing->args[2]) << FRACBITS; mobj->radius = abs(mthing->thing_args[2]) << FRACBITS;
// FALLTHRU // FALLTHRU
case MT_AXISTRANSFER: case MT_AXISTRANSFER:
case MT_AXISTRANSFERLINE: case MT_AXISTRANSFERLINE:
// Mare it belongs to // Mare it belongs to
mobj->threshold = min(mthing->args[0], 7); mobj->threshold = min(mthing->thing_args[0], 7);
// # in the mare // # in the mare
mobj->health = mthing->args[1]; mobj->health = mthing->thing_args[1];
mobj->flags2 |= MF2_AXIS; mobj->flags2 |= MF2_AXIS;
break; break;
case MT_STARPOST: case MT_STARPOST:
mobj->health = mthing->args[0] + 1; mobj->health = mthing->thing_args[0] + 1;
if (!P_MapAlreadyHasStarPost(mobj)) if (!P_MapAlreadyHasStarPost(mobj))
numstarposts++; numstarposts++;
break; break;
case MT_SPIKE: case MT_SPIKE:
// Pop up spikes! // Pop up spikes!
if (mthing->args[0]) if (mthing->thing_args[0])
{ {
mobj->flags &= ~MF_SCENERY; 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); P_SetMobjState(mobj, mobj->info->meleestate);
// Use per-thing collision for spikes unless the intangible flag is checked. // 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); P_UnsetThingPosition(mobj);
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT); mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT);
@ -13110,15 +13110,15 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break; break;
case MT_WALLSPIKE: case MT_WALLSPIKE:
// Pop up spikes! // Pop up spikes!
if (mthing->args[0]) if (mthing->thing_args[0])
{ {
mobj->flags &= ~MF_SCENERY; 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); P_SetMobjState(mobj, mobj->info->meleestate);
// Use per-thing collision for spikes unless the intangible flag is checked. // 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); P_UnsetThingPosition(mobj);
mobj->flags &= ~(MF_NOBLOCKMAP | MF_NOCLIPHEIGHT); mobj->flags &= ~(MF_NOBLOCKMAP | MF_NOCLIPHEIGHT);
@ -13142,7 +13142,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break; break;
case MT_BIGTUMBLEWEED: case MT_BIGTUMBLEWEED:
case MT_LITTLETUMBLEWEED: case MT_LITTLETUMBLEWEED:
if (mthing->args[0]) if (mthing->thing_args[0])
{ {
fixed_t offset = FixedMul(16*FRACUNIT, mobj->scale); fixed_t offset = FixedMul(16*FRACUNIT, mobj->scale);
mobj->momx += P_RandomChance(PR_DECORATION, FRACUNIT/2) ? offset : -offset; 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; break;
case MT_AMBIENT: case MT_AMBIENT:
if (mthing->stringargs[0]) if (mthing->thing_stringargs[0])
mobj->threshold = get_number(mthing->stringargs[0]); mobj->threshold = get_number(mthing->thing_stringargs[0]);
mobj->health = mthing->args[0] ? mthing->args[0] : TICRATE; mobj->health = mthing->thing_args[0] ? mthing->thing_args[0] : TICRATE;
break; break;
// SRB2Kart // SRB2Kart
case MT_WAYPOINT: case MT_WAYPOINT:
@ -13163,8 +13163,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
mapheaderinfo[gamemap-1]->default_waypoint_radius; mapheaderinfo[gamemap-1]->default_waypoint_radius;
mtag_t tag = mthing->tid; mtag_t tag = mthing->tid;
if (mthing->args[1] > 0) if (mthing->thing_args[1] > 0)
mobj->radius = (mthing->args[1]) * FRACUNIT; mobj->radius = (mthing->thing_args[1]) * FRACUNIT;
else if (mobjscale > 0) else if (mobjscale > 0)
mobj->radius = mobjscale; mobj->radius = mobjscale;
else 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 // lastlook is used for indicating the waypoint is a shortcut
// extravalue1 is used for indicating the waypoint is disabled // extravalue1 is used for indicating the waypoint is disabled
// extravalue2 is used for indicating the waypoint is the finishline // extravalue2 is used for indicating the waypoint is the finishline
mobj->threshold = mthing->args[0]; mobj->threshold = mthing->thing_args[0];
mobj->movecount = tag; 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 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; 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 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; 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 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; 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->extravalue2 = 1; // args[2] of 1 means the waypoint is at the finish line
mobj->reactiontime = 0; // Also don't respawn at finish lines 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: case MT_BOTHINT:
{ {
// Change size // 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 else
{ {
@ -13232,7 +13232,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
} }
// Steer away instead of towards // Steer away instead of towards
if (mthing->args[2]) if (mthing->thing_args[2])
{ {
mobj->extravalue1 = 0; mobj->extravalue1 = 0;
} }
@ -13242,13 +13242,13 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
} }
// Steering amount // Steering amount
if (mthing->args[1] == 0) if (mthing->thing_args[1] == 0)
{ {
mobj->extravalue2 = 4; mobj->extravalue2 = 4;
} }
else else
{ {
mobj->extravalue2 = mthing->args[1]; mobj->extravalue2 = mthing->thing_args[1];
} }
break; break;
} }
@ -13266,7 +13266,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
P_SetThingPosition(mobj); P_SetThingPosition(mobj);
} }
} }
if (mthing->args[0] == 1) if (mthing->thing_args[0] == 1)
mobj->flags2 |= MF2_AMBUSH; mobj->flags2 |= MF2_AMBUSH;
break; break;
} }
@ -13289,14 +13289,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
mobj->flags |= MF_NOGRAVITY; mobj->flags |= MF_NOGRAVITY;
// Angle = item type // Angle = item type
if (mthing->args[0] > 0 && mthing->args[0] < NUMKARTITEMS) if (mthing->thing_args[0] > 0 && mthing->thing_args[0] < NUMKARTITEMS)
mobj->threshold = mthing->args[0]; mobj->threshold = mthing->thing_args[0];
// Parameter = extra items (x5 for rings) // Parameter = extra items (x5 for rings)
mobj->movecount += mthing->args[1]; mobj->movecount += mthing->thing_args[1];
// Ambush = double size (grounded) / half size (aerial) // 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->extravalue1 = min(mobj->extravalue1 << 1, FixedDiv(MAPBLOCKSIZE, mobj->info->radius)); // don't make them larger than the blockmap can handle
mobj->scalespeed <<= 1; mobj->scalespeed <<= 1;
@ -13305,17 +13305,17 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
} }
case MT_RANDOMAUDIENCE: case MT_RANDOMAUDIENCE:
{ {
if (mthing->args[2] & TMAUDIM_FLOAT) if (mthing->thing_args[2] & TMAUDIM_FLOAT)
{ {
mobj->flags |= MF_NOGRAVITY; mobj->flags |= MF_NOGRAVITY;
} }
if (mthing->args[2] & TMAUDIM_BORED) if (mthing->thing_args[2] & TMAUDIM_BORED)
{ {
mobj->flags2 |= MF2_BOSSNOTRAP; mobj->flags2 |= MF2_BOSSNOTRAP;
} }
if (mthing->args[3] != 0) if (mthing->thing_args[3] != 0)
{ {
mobj->flags2 |= MF2_AMBUSH; mobj->flags2 |= MF2_AMBUSH;
} }
@ -13331,8 +13331,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
{ {
fixed_t top = mobj->z; fixed_t top = mobj->z;
UINT8 i; UINT8 i;
UINT8 locnumsegs = abs(mthing->args[0])+2; UINT8 locnumsegs = abs(mthing->thing_args[0])+2;
UINT8 numleaves = max(3, (abs(mthing->args[1])+1 % 6) + 3); UINT8 numleaves = max(3, (abs(mthing->thing_args[1])+1 % 6) + 3);
mobj_t *coconut; mobj_t *coconut;
// Spawn tree segments // Spawn tree segments
@ -13368,7 +13368,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
case MT_SUNBEAMPALM_STEM: case MT_SUNBEAMPALM_STEM:
{ {
UINT8 i; 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; 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! // Moving capsules!
if (mthing->args[0] && mthing->args[1]) if (mthing->thing_args[0] && mthing->thing_args[1])
{ {
K_SetupMovingCapsule(mthing, mobj); K_SetupMovingCapsule(mthing, mobj);
} }
@ -13539,7 +13539,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
{ {
Obj_DuelBombInit(mobj); Obj_DuelBombInit(mobj);
if (mthing->args[1]) if (mthing->thing_args[1])
{ {
Obj_DuelBombReverse(mobj); Obj_DuelBombReverse(mobj);
} }
@ -13597,7 +13597,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
if (mobj->flags & MF_BOSS) 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; 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++) 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++) for (arg = 0; arg < NUM_MAPTHING_STRINGARGS; arg++)
{ {
size_t len = 0; 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) if (len == 0)
{ {
Z_Free(mobj->stringargs[arg]); Z_Free(mobj->thing_stringargs[arg]);
mobj->stringargs[arg] = NULL; mobj->thing_stringargs[arg] = NULL;
continue; continue;
} }
mobj->stringargs[arg] = Z_Realloc(mobj->stringargs[arg], len + 1, PU_LEVEL, NULL); mobj->thing_stringargs[arg] = Z_Realloc(mobj->thing_stringargs[arg], len + 1, PU_LEVEL, NULL);
M_Memcpy(mobj->stringargs[arg], mthing->stringargs[arg], len + 1); M_Memcpy(mobj->thing_stringargs[arg], mthing->thing_stringargs[arg], len + 1);
} }
for (arg = 0; arg < NUM_SCRIPT_ARGS; arg++) 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++) for (arg = 0; arg < NUM_SCRIPT_STRINGARGS; arg++)
@ -13756,7 +13756,7 @@ void P_SpawnHoop(mapthing_t *mthing)
mobj_t *nextmobj = NULL; mobj_t *nextmobj = NULL;
mobj_t *hoopcenter; mobj_t *hoopcenter;
TMatrix *pitchmatrix, *yawmatrix; 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 sizefactor = 4*FRACUNIT;
fixed_t hoopsize = radius/sizefactor; fixed_t hoopsize = radius/sizefactor;
INT32 i; INT32 i;
@ -13908,7 +13908,7 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi
loopanchor->spawnpoint = NULL; loopanchor->spawnpoint = NULL;
Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->args[0]); Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->thing_args[0]);
} }
for (r = 0; r < numitems; r++) for (r = 0; r < numitems; r++)
@ -14064,8 +14064,8 @@ void P_SpawnItemPattern(mapthing_t *mthing)
UINT8 numitemtypes; UINT8 numitemtypes;
if (!udmf) if (!udmf)
return; return;
P_ParseItemTypes(mthing->stringargs[0], itemtypes, &numitemtypes); P_ParseItemTypes(mthing->thing_stringargs[0], itemtypes, &numitemtypes);
P_SpawnItemRow(mthing, itemtypes, numitemtypes, mthing->args[0], mthing->args[1] << FRACBITS, mthing->args[2] << FRACBITS, mthing->angle); P_SpawnItemRow(mthing, itemtypes, numitemtypes, mthing->thing_args[0], mthing->thing_args[1] << FRACBITS, mthing->thing_args[2] << FRACBITS, mthing->angle);
return; return;
} }
case 611: // Generic item circle case 611: // Generic item circle
@ -14074,9 +14074,8 @@ void P_SpawnItemPattern(mapthing_t *mthing)
UINT8 numitemtypes; UINT8 numitemtypes;
if (!udmf) if (!udmf)
return; return;
CONS_Printf("Itemstring: %s\n", mthing->stringargs[0]); P_ParseItemTypes(mthing->thing_stringargs[0], itemtypes, &numitemtypes);
P_ParseItemTypes(mthing->stringargs[0], itemtypes, &numitemtypes); P_SpawnItemCircle(mthing, itemtypes, numitemtypes, mthing->thing_args[0], mthing->thing_args[1] << FRACBITS);
P_SpawnItemCircle(mthing, itemtypes, numitemtypes, mthing->args[0], mthing->args[1] << FRACBITS);
return; return;
} }
default: default:
@ -14739,8 +14738,8 @@ void P_DeleteMobjStringArgs(mobj_t *mobj)
for (i = 0; i < NUM_MAPTHING_STRINGARGS; i++) for (i = 0; i < NUM_MAPTHING_STRINGARGS; i++)
{ {
Z_Free(mobj->stringargs[i]); Z_Free(mobj->thing_stringargs[i]);
mobj->stringargs[i] = NULL; mobj->thing_stringargs[i] = NULL;
} }
for (i = 0; i < NUM_SCRIPT_STRINGARGS; i++) for (i = 0; i < NUM_SCRIPT_STRINGARGS; i++)

View file

@ -426,8 +426,8 @@ struct mobj_t
INT32 dispoffset; INT32 dispoffset;
INT32 args[NUM_MAPTHING_ARGS]; INT32 thing_args[NUM_MAPTHING_ARGS];
char *stringargs[NUM_MAPTHING_STRINGARGS]; char *thing_stringargs[NUM_MAPTHING_STRINGARGS];
INT16 special; INT16 special;
INT32 script_args[NUM_SCRIPT_ARGS]; INT32 script_args[NUM_SCRIPT_ARGS];

View file

@ -2319,7 +2319,7 @@ static boolean P_ThingArgsEqual(const mobj_t *mobj, const mapthing_t *mapthing)
{ {
UINT8 i; UINT8 i;
for (i = 0; i < NUM_MAPTHING_ARGS; 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 false;
return true; return true;
@ -2330,10 +2330,10 @@ static boolean P_ThingStringArgsEqual(const mobj_t *mobj, const mapthing_t *mapt
UINT8 i; UINT8 i;
for (i = 0; i < NUM_MAPTHING_STRINGARGS; i++) for (i = 0; i < NUM_MAPTHING_STRINGARGS; i++)
{ {
if (!mobj->stringargs[i]) if (!mobj->thing_stringargs[i])
return !mapthing->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; 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++) for (j = 0; j < NUM_MAPTHING_ARGS; j++)
{ {
if (mobj->args[j] != 0) if (mobj->thing_args[j] != 0)
{ {
diff |= MD_ARGS; diff |= MD_ARGS;
break; 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++) for (j = 0; j < NUM_MAPTHING_STRINGARGS; j++)
{ {
if (mobj->stringargs[j] != NULL) if (mobj->thing_stringargs[j] != NULL)
{ {
diff |= MD_STRINGARGS; diff |= MD_STRINGARGS;
break; 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++) for (j = 0; j < NUM_SCRIPT_STRINGARGS; j++)
{ {
if (mobj->stringargs[j] != NULL) if (mobj->script_stringargs[j] != NULL)
{ {
diff2 |= MD2_SPECIAL; diff2 |= MD2_SPECIAL;
break; break;
@ -2867,7 +2867,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
if (diff & MD_ARGS) if (diff & MD_ARGS)
{ {
for (j = 0; j < NUM_MAPTHING_ARGS; j++) 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) if (diff & MD_STRINGARGS)
{ {
@ -2875,16 +2875,16 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
{ {
size_t len, k; size_t len, k;
if (!mobj->stringargs[j]) if (!mobj->thing_stringargs[j])
{ {
WRITEINT32(save->p, 0); WRITEINT32(save->p, 0);
continue; continue;
} }
len = strlen(mobj->stringargs[j]); len = strlen(mobj->thing_stringargs[j]);
WRITEINT32(save->p, len); WRITEINT32(save->p, len);
for (k = 0; k < len; k++) 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) if (diff2 & MD2_CUSVAL)
@ -4091,7 +4091,7 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
if (diff & MD_ARGS) if (diff & MD_ARGS)
{ {
for (j = 0; j < NUM_MAPTHING_ARGS; j++) 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) if (diff & MD_STRINGARGS)
{ {
@ -4102,15 +4102,15 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
if (!len) if (!len)
{ {
Z_Free(mobj->stringargs[j]); Z_Free(mobj->thing_stringargs[j]);
mobj->stringargs[j] = NULL; mobj->thing_stringargs[j] = NULL;
continue; 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++) for (k = 0; k < len; k++)
mobj->stringargs[j][k] = READCHAR(save->p); mobj->thing_stringargs[j][k] = READCHAR(save->p);
mobj->stringargs[j][len] = '\0'; mobj->thing_stringargs[j][len] = '\0';
} }
} }
if (diff2 & MD2_CUSVAL) if (diff2 & MD2_CUSVAL)

File diff suppressed because it is too large Load diff

View file

@ -640,7 +640,7 @@ static pslope_t *MakeViaMapthings(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag
vx[i].x = mt->x << FRACBITS; vx[i].x = mt->x << FRACBITS;
vx[i].y = mt->y << FRACBITS; vx[i].y = mt->y << FRACBITS;
vx[i].z = mt->z << 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; vx[i].z += R_PointInSubsector(vx[i].x, vx[i].y)->sector->floorheight;
} }

View file

@ -199,7 +199,7 @@ get_anchor
for (i = 0; i < list->count; ++i) 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) for (k = 0; k < 3; ++k)
{ {