summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hexen/a_action.c78
-rw-r--r--src/hexen/g_game.c2
-rw-r--r--src/hexen/h2def.h11
-rw-r--r--src/hexen/p_enemy.c210
-rw-r--r--src/hexen/p_inter.c18
-rw-r--r--src/hexen/p_map.c30
-rw-r--r--src/hexen/p_maputl.c6
-rw-r--r--src/hexen/p_mobj.c14
-rw-r--r--src/hexen/p_pspr.c182
-rw-r--r--src/hexen/p_things.c2
-rw-r--r--src/hexen/p_user.c26
-rw-r--r--src/hexen/r_things.c2
-rw-r--r--src/hexen/sv_save.c26
13 files changed, 306 insertions, 301 deletions
diff --git a/src/hexen/a_action.c b/src/hexen/a_action.c
index a202733d..af727480 100644
--- a/src/hexen/a_action.c
+++ b/src/hexen/a_action.c
@@ -311,7 +311,7 @@ void A_LeafSpawn(mobj_t * actor)
{
P_ThrustMobj(mo, actor->angle, (P_Random() << 9) + 3 * FRACUNIT);
mo->target = actor;
- mo->special1 = 0;
+ mo->special1.i = 0;
}
}
}
@@ -339,8 +339,8 @@ void A_LeafThrust(mobj_t * actor)
void A_LeafCheck(mobj_t * actor)
{
- actor->special1++;
- if (actor->special1 >= 20)
+ actor->special1.i++;
+ if (actor->special1.i >= 20)
{
P_SetMobjState(actor, S_NULL);
return;
@@ -415,7 +415,7 @@ void GenerateOrbitTable(void)
void A_BridgeOrbit(mobj_t * actor)
{
- if (actor->target->special1)
+ if (actor->target->special1.i)
{
P_SetMobjState(actor, S_NULL);
}
@@ -438,7 +438,7 @@ void A_BridgeInit(mobj_t * actor)
cy = actor->y;
cz = actor->z;
startangle = P_Random();
- actor->special1 = 0;
+ actor->special1.i = 0;
// Spawn triad into world
ball1 = P_SpawnMobj(cx, cy, cz, MT_BRIDGEBALL);
@@ -460,7 +460,7 @@ void A_BridgeInit(mobj_t * actor)
void A_BridgeRemove(mobj_t * actor)
{
- actor->special1 = true; // Removing the bridge
+ actor->special1.i = true; // Removing the bridge
actor->flags &= ~MF_SOLID;
P_SetMobjState(actor, S_FREE_BRIDGE1);
}
@@ -630,7 +630,7 @@ void A_Summon(mobj_t * actor)
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINOTAUR);
if (mo)
{
- if (P_TestMobjLocation(mo) == false || !actor->special1)
+ if (P_TestMobjLocation(mo) == false || !actor->special1.m)
{ // Didn't fit - change back to artifact
P_SetMobjState(mo, S_NULL);
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SUMMONMAULATOR);
@@ -640,14 +640,14 @@ void A_Summon(mobj_t * actor)
}
memcpy((void *) mo->args, &leveltime, sizeof(leveltime));
- master = (mobj_t *) actor->special1;
+ master = actor->special1.m;
if (master->flags & MF_CORPSE)
{ // Master dead
- mo->special1 = 0; // No master
+ mo->special1.m = NULL; // No master
}
else
{
- mo->special1 = actor->special1; // Pointer to master (mobj_t *)
+ mo->special1.m = actor->special1.m; // Pointer to master (mobj_t *)
P_GivePower(master->player, pw_minotaur);
}
@@ -677,10 +677,10 @@ void A_FogSpawn(mobj_t * actor)
mobj_t *mo = NULL;
angle_t delta;
- if (actor->special1-- > 0)
+ if (actor->special1.i-- > 0)
return;
- actor->special1 = actor->args[2]; // Reset frequency count
+ actor->special1.i = actor->args[2]; // Reset frequency count
switch (P_Random() % 3)
{
@@ -708,7 +708,7 @@ void A_FogSpawn(mobj_t * actor)
mo->args[0] = (P_Random() % (actor->args[0])) + 1; // Random speed
mo->args[3] = actor->args[3]; // Set lifetime
mo->args[4] = 1; // Set to moving
- mo->special2 = P_Random() & 63;
+ mo->special2.i = P_Random() & 63;
}
}
@@ -730,9 +730,9 @@ void A_FogMove(mobj_t * actor)
if ((actor->args[3] % 4) == 0)
{
- weaveindex = actor->special2;
+ weaveindex = actor->special2.i;
actor->z += FloatBobOffsets[weaveindex] >> 1;
- actor->special2 = (weaveindex + 1) & 63;
+ actor->special2.i = (weaveindex + 1) & 63;
}
angle = actor->angle >> ANGLETOFINESHIFT;
@@ -757,8 +757,8 @@ void A_PoisonBagInit(mobj_t * actor)
return;
}
mo->momx = 1; // missile objects must move to impact other objects
- mo->special1 = 24 + (P_Random() & 7);
- mo->special2 = 0;
+ mo->special1.i = 24 + (P_Random() & 7);
+ mo->special2.i = 0;
mo->target = actor->target;
mo->radius = 20 * FRACUNIT;
mo->height = 30 * FRACUNIT;
@@ -773,7 +773,7 @@ void A_PoisonBagInit(mobj_t * actor)
void A_PoisonBagCheck(mobj_t * actor)
{
- if (!--actor->special1)
+ if (!--actor->special1.i)
{
P_SetMobjState(actor, S_POISONCLOUD_X1);
}
@@ -797,9 +797,9 @@ void A_PoisonBagDamage(mobj_t * actor)
A_Explode(actor);
- bobIndex = actor->special2;
+ bobIndex = actor->special2.i;
actor->z += FloatBobOffsets[bobIndex] >> 4;
- actor->special2 = (bobIndex + 1) & 63;
+ actor->special2.i = (bobIndex + 1) & 63;
}
//===========================================================================
@@ -960,7 +960,7 @@ void A_TeloSpawnA(mobj_t * actor)
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_TELOTHER_FX2);
if (mo)
{
- mo->special1 = TELEPORT_LIFE; // Lifetime countdown
+ mo->special1.i = TELEPORT_LIFE; // Lifetime countdown
mo->angle = actor->angle;
mo->target = actor->target;
mo->momx = actor->momx >> 1;
@@ -976,7 +976,7 @@ void A_TeloSpawnB(mobj_t * actor)
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_TELOTHER_FX3);
if (mo)
{
- mo->special1 = TELEPORT_LIFE; // Lifetime countdown
+ mo->special1.i = TELEPORT_LIFE; // Lifetime countdown
mo->angle = actor->angle;
mo->target = actor->target;
mo->momx = actor->momx >> 1;
@@ -992,7 +992,7 @@ void A_TeloSpawnC(mobj_t * actor)
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_TELOTHER_FX4);
if (mo)
{
- mo->special1 = TELEPORT_LIFE; // Lifetime countdown
+ mo->special1.i = TELEPORT_LIFE; // Lifetime countdown
mo->angle = actor->angle;
mo->target = actor->target;
mo->momx = actor->momx >> 1;
@@ -1008,7 +1008,7 @@ void A_TeloSpawnD(mobj_t * actor)
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_TELOTHER_FX5);
if (mo)
{
- mo->special1 = TELEPORT_LIFE; // Lifetime countdown
+ mo->special1.i = TELEPORT_LIFE; // Lifetime countdown
mo->angle = actor->angle;
mo->target = actor->target;
mo->momx = actor->momx >> 1;
@@ -1019,7 +1019,7 @@ void A_TeloSpawnD(mobj_t * actor)
void A_CheckTeleRing(mobj_t * actor)
{
- if (actor->special1-- <= 0)
+ if (actor->special1.i-- <= 0)
{
P_SetMobjState(actor, actor->info->deathstate);
}
@@ -1087,24 +1087,24 @@ void P_SpawnDirt(mobj_t * actor, fixed_t radius)
void A_ThrustInitUp(mobj_t * actor)
{
- actor->special2 = 5; // Raise speed
+ actor->special2.i = 5; // Raise speed
actor->args[0] = 1; // Mark as up
actor->floorclip = 0;
actor->flags = MF_SOLID;
actor->flags2 = MF2_NOTELEPORT | MF2_FLOORCLIP;
- actor->special1 = 0L;
+ actor->special1.m = NULL;
}
void A_ThrustInitDn(mobj_t * actor)
{
mobj_t *mo;
- actor->special2 = 5; // Raise speed
+ actor->special2.i = 5; // Raise speed
actor->args[0] = 0; // Mark as down
actor->floorclip = actor->info->height;
actor->flags = 0;
actor->flags2 = MF2_NOTELEPORT | MF2_FLOORCLIP | MF2_DONTDRAW;
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_DIRTCLUMP);
- actor->special1 = (int) mo;
+ actor->special1.m = mo;
}
@@ -1120,16 +1120,16 @@ void A_ThrustRaise(mobj_t * actor)
}
// Lose the dirt clump
- if ((actor->floorclip < actor->height) && actor->special1)
+ if ((actor->floorclip < actor->height) && actor->special1.m)
{
- P_RemoveMobj((mobj_t *) actor->special1);
- actor->special1 = 0;
+ P_RemoveMobj(actor->special1.m);
+ actor->special1.m = NULL;
}
// Spawn some dirt
if (P_Random() < 40)
P_SpawnDirt(actor, actor->radius);
- actor->special2++; // Increase raise speed
+ actor->special2.i++; // Increase raise speed
}
void A_ThrustLower(mobj_t * actor)
@@ -1252,7 +1252,7 @@ void A_FlameCheck(mobj_t * actor)
void A_BatSpawnInit(mobj_t * actor)
{
- actor->special1 = 0; // Frequency count
+ actor->special1.i = 0; // Frequency count
}
void A_BatSpawn(mobj_t * actor)
@@ -1262,9 +1262,9 @@ void A_BatSpawn(mobj_t * actor)
angle_t angle;
// Countdown until next spawn
- if (actor->special1-- > 0)
+ if (actor->special1.i-- > 0)
return;
- actor->special1 = actor->args[0]; // Reset frequency count
+ actor->special1.i = actor->args[0]; // Reset frequency count
delta = actor->args[1];
if (delta == 0)
@@ -1275,7 +1275,7 @@ void A_BatSpawn(mobj_t * actor)
{
mo->args[0] = P_Random() & 63; // floatbob index
mo->args[4] = actor->args[4]; // turn degrees
- mo->special2 = actor->args[3] << 3; // Set lifetime
+ mo->special2.i = actor->args[3] << 3; // Set lifetime
mo->target = actor;
}
}
@@ -1286,11 +1286,11 @@ void A_BatMove(mobj_t * actor)
angle_t newangle;
fixed_t speed;
- if (actor->special2 < 0)
+ if (actor->special2.i < 0)
{
P_SetMobjState(actor, actor->info->deathstate);
}
- actor->special2 -= 2; // Called every 2 tics
+ actor->special2.i -= 2; // Called every 2 tics
if (P_Random() < 128)
{
diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c
index fa115e56..b83a439b 100644
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -1051,7 +1051,7 @@ void G_PlayerExitMap(int playerNumber)
if (player->morphTics)
{
- player->readyweapon = player->mo->special1; // Restore weapon
+ player->readyweapon = player->mo->special1.i; // Restore weapon
player->morphTics = 0;
}
player->messageTics = 0;
diff --git a/src/hexen/h2def.h b/src/hexen/h2def.h
index 7910cde8..faa2d3f8 100644
--- a/src/hexen/h2def.h
+++ b/src/hexen/h2def.h
@@ -172,6 +172,13 @@ typedef struct thinker_s
struct player_s;
+typedef union
+{
+ int i;
+ struct mobj_s *m;
+ struct player_s *p;
+} specialval_t;
+
typedef struct mobj_s
{
thinker_t thinker; // thinker node
@@ -198,8 +205,8 @@ typedef struct mobj_s
int damage; // For missiles
int flags;
int flags2; // Heretic flags
- int special1; // Special info
- int special2; // Special info
+ specialval_t special1; // Special info
+ specialval_t special2; // Special info
int health;
int movedir; // 0-7
int movecount; // when 0, select a new dir
diff --git a/src/hexen/p_enemy.c b/src/hexen/p_enemy.c
index 14bc4f49..456cc7a9 100644
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -502,7 +502,7 @@ boolean P_LookForMonsters(mobj_t * actor)
if (actor->type == MT_MINOTAUR)
{
if ((mo->type == MT_MINOTAUR) &&
- (mo->target != ((player_t *) actor->special1)->mo))
+ (mo->target != actor->special1.p->mo))
{
continue;
}
@@ -583,7 +583,7 @@ boolean P_LookForPlayers(mobj_t * actor, boolean allaround)
}
if (actor->type == MT_MINOTAUR)
{
- if (((player_t *) (actor->special1)) == player)
+ if (actor->special1.p == player)
{
continue; // Don't target master
}
@@ -904,12 +904,12 @@ boolean P_UpdateMorphedMonster(mobj_t * actor, int tics)
mobj_t *mo;
mobj_t oldMonster;
- actor->special1 -= tics;
- if (actor->special1 > 0)
+ actor->special1.i -= tics;
+ if (actor->special1.i > 0)
{
return (false);
}
- moType = actor->special2;
+ moType = actor->special2.i;
switch (moType)
{
case MT_WRAITHB: // These must remain morphed
@@ -938,8 +938,8 @@ boolean P_UpdateMorphedMonster(mobj_t * actor, int tics)
mo->health = oldMonster.health;
mo->target = oldMonster.target;
mo->special = oldMonster.special;
- mo->special1 = 5 * 35; // Next try in 5 seconds
- mo->special2 = moType;
+ mo->special1.i = 5 * 35; // Next try in 5 seconds
+ mo->special2.i = moType;
mo->tid = oldMonster.tid;
memcpy(mo->args, oldMonster.args, 5);
P_InsertMobjIntoTIDList(mo, oldMonster.tid);
@@ -1150,7 +1150,7 @@ void A_MinotaurLook(mobj_t * actor)
thinker_t *think;
fixed_t dist;
int i;
- mobj_t *master = (mobj_t *) (actor->special1);
+ mobj_t *master = actor->special1.m;
actor->target = NULL;
if (deathmatch) // Quick search for players
@@ -1202,7 +1202,7 @@ void A_MinotaurLook(mobj_t * actor)
if ((mo == master) || (mo == actor))
continue;
if ((mo->type == MT_MINOTAUR) &&
- (mo->special1 == actor->special1))
+ (mo->special1.m == actor->special1.m))
continue;
actor->target = mo;
break; // Found mobj to attack
@@ -1339,7 +1339,7 @@ void A_MinotaurDecide(mobj_t * actor)
&& dist < 9 * 64 * FRACUNIT && P_Random() < 100)
{ // Floor fire attack
P_SetMobjState(actor, S_MNTR_ATK3_1);
- actor->special2 = 0;
+ actor->special2.i = 0;
}
else
{ // Swing attack
@@ -1444,10 +1444,10 @@ void A_MinotaurAtk3(mobj_t * actor)
S_StartSound(mo, SFX_MAULATOR_HAMMER_HIT);
}
}
- if (P_Random() < 192 && actor->special2 == 0)
+ if (P_Random() < 192 && actor->special2.i == 0)
{
P_SetMobjState(actor, S_MNTR_ATK3_4);
- actor->special2 = 1;
+ actor->special2.i = 1;
}
}
@@ -1758,7 +1758,7 @@ void A_SkullPop(mobj_t * actor)
// Attach player mobj to bloody skull
player = actor->player;
actor->player = NULL;
- actor->special1 = player->class;
+ actor->special1.i = player->class;
mo->player = player;
mo->health = actor->health;
mo->angle = actor->angle;
@@ -1790,7 +1790,7 @@ void A_CheckSkullFloor(mobj_t * actor)
void A_CheckSkullDone(mobj_t * actor)
{
- if (actor->special2 == 666)
+ if (actor->special2.i == 666)
{
P_SetMobjState(actor, S_BLOODYSKULLX2);
}
@@ -1804,7 +1804,7 @@ void A_CheckSkullDone(mobj_t * actor)
void A_CheckBurnGone(mobj_t * actor)
{
- if (actor->special2 == 666)
+ if (actor->special2.i == 666)
{
P_SetMobjState(actor, S_PLAY_FDTH20);
}
@@ -2578,7 +2578,7 @@ void A_BishopAttack(mobj_t * actor)
P_DamageMobj(actor->target, actor, actor, HITDICE(4));
return;
}
- actor->special1 = (P_Random() & 3) + 5;
+ actor->special1.i = (P_Random() & 3) + 5;
}
//============================================================================
@@ -2592,19 +2592,19 @@ void A_BishopAttack2(mobj_t * actor)
{
mobj_t *mo;
- if (!actor->target || !actor->special1)
+ if (!actor->target || !actor->special1.i)
{
- actor->special1 = 0;
+ actor->special1.i = 0;
P_SetMobjState(actor, S_BISHOP_WALK1);
return;
}
mo = P_SpawnMissile(actor, actor->target, MT_BISH_FX);
if (mo)
{
- mo->special1 = (int) actor->target;
- mo->special2 = 16; // High word == x/y, Low word == z
+ mo->special1.m = actor->target;
+ mo->special2.i = 16; // High word == x/y, Low word == z
}
- actor->special1--;
+ actor->special1.i--;
}
//============================================================================
@@ -2619,8 +2619,8 @@ void A_BishopMissileWeave(mobj_t * actor)
int weaveXY, weaveZ;
int angle;
- weaveXY = actor->special2 >> 16;
- weaveZ = actor->special2 & 0xFFFF;
+ weaveXY = actor->special2.i >> 16;
+ weaveZ = actor->special2.i & 0xFFFF;
angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
newX = actor->x - FixedMul(finecosine[angle],
FloatBobOffsets[weaveXY] << 1);
@@ -2633,7 +2633,7 @@ void A_BishopMissileWeave(mobj_t * actor)
actor->z -= FloatBobOffsets[weaveZ];
weaveZ = (weaveZ + 2) & 63;
actor->z += FloatBobOffsets[weaveZ];
- actor->special2 = weaveZ + (weaveXY << 16);
+ actor->special2.i = weaveZ + (weaveXY << 16);
}
//============================================================================
@@ -2673,7 +2673,7 @@ void A_BishopDecide(mobj_t * actor)
void A_BishopDoBlur(mobj_t * actor)
{
- actor->special1 = (P_Random() & 3) + 3; // Random number of blurs
+ actor->special1.i = (P_Random() & 3) + 3; // Random number of blurs
if (P_Random() < 120)
{
P_ThrustMobj(actor, actor->angle + ANG90, 11 * FRACUNIT);
@@ -2699,7 +2699,7 @@ void A_BishopSpawnBlur(mobj_t * actor)
{
mobj_t *mo;
- if (!--actor->special1)
+ if (!--actor->special1.i)
{
actor->momx = 0;
actor->momy = 0;
@@ -2727,9 +2727,9 @@ void A_BishopSpawnBlur(mobj_t * actor)
void A_BishopChase(mobj_t * actor)
{
- actor->z -= FloatBobOffsets[actor->special2] >> 1;
- actor->special2 = (actor->special2 + 4) & 63;
- actor->z += FloatBobOffsets[actor->special2] >> 1;
+ actor->z -= FloatBobOffsets[actor->special2.i] >> 1;
+ actor->special2.i = (actor->special2.i + 4) & 63;
+ actor->z += FloatBobOffsets[actor->special2.i] >> 1;
}
//============================================================================
@@ -2795,7 +2795,7 @@ static void DragonSeek(mobj_t * actor, angle_t thresh, angle_t turnMax)
angle_t angleToSpot, angleToTarget;
mobj_t *mo;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return;
@@ -2887,8 +2887,8 @@ static void DragonSeek(mobj_t * actor, angle_t thresh, angle_t turnMax)
if (bestArg != -1)
{
search = -1;
- actor->special1 =
- (int) P_FindMobjFromTID(target->args[bestArg], &search);
+ actor->special1.m =
+ P_FindMobjFromTID(target->args[bestArg], &search);
}
}
else
@@ -2899,8 +2899,8 @@ static void DragonSeek(mobj_t * actor, angle_t thresh, angle_t turnMax)
}
while (!target->args[i]);
search = -1;
- actor->special1 =
- (int) P_FindMobjFromTID(target->args[i], &search);
+ actor->special1.m =
+ P_FindMobjFromTID(target->args[i], &search);
}
}
}
@@ -2918,14 +2918,14 @@ void A_DragonInitFlight(mobj_t * actor)
search = -1;
do
{ // find the first tid identical to the dragon's tid
- actor->special1 = (int) P_FindMobjFromTID(actor->tid, &search);
+ actor->special1.m = P_FindMobjFromTID(actor->tid, &search);
if (search == -1)
{
P_SetMobjState(actor, actor->info->spawnstate);
return;
}
}
- while (actor->special1 == (int) actor);
+ while (actor->special1.m == actor);
P_RemoveMobjFromTIDList(actor);
}
@@ -3035,7 +3035,7 @@ void A_DragonFX2(mobj_t * actor)
void A_DragonPain(mobj_t * actor)
{
A_Pain(actor);
- if (!actor->special1)
+ if (!actor->special1.i)
{ // no destination spot yet
P_SetMobjState(actor, S_DRAGON_INIT);
}
@@ -3284,7 +3284,7 @@ boolean A_RaiseMobj(mobj_t * actor)
break;
case MT_THRUSTFLOOR_DOWN:
case MT_THRUSTFLOOR_UP:
- actor->floorclip -= actor->special2 * FRACUNIT;
+ actor->floorclip -= actor->special2.i * FRACUNIT;
break;
default:
actor->floorclip -= 2 * FRACUNIT;
@@ -3318,7 +3318,7 @@ boolean A_RaiseMobj(mobj_t * actor)
void A_WraithInit(mobj_t * actor)
{
actor->z += 48 << FRACBITS;
- actor->special1 = 0; // index into floatbob
+ actor->special1.i = 0; // index into floatbob
}
void A_WraithRaiseInit(mobj_t * actor)
@@ -3483,9 +3483,9 @@ void A_WraithLook(mobj_t * actor)
void A_WraithChase(mobj_t * actor)
{
- int weaveindex = actor->special1;
+ int weaveindex = actor->special1.i;
actor->z += FloatBobOffsets[weaveindex];
- actor->special1 = (weaveindex + 2) & 63;
+ actor->special1.i = (weaveindex + 2) & 63;
// if (actor->floorclip > 0)
// {
// P_SetMobjState(actor, S_WRAITH_RAISE2);
@@ -3568,11 +3568,11 @@ void A_FiredSpawnRock(mobj_t * actor)
mo->momx = (P_Random() - 128) << 10;
mo->momy = (P_Random() - 128) << 10;
mo->momz = (P_Random() << 10);
- mo->special1 = 2; // Number bounces
+ mo->special1.i = 2; // Number bounces
}
// Initialize fire demon
- actor->special2 = 0;
+ actor->special2.i = 0;
actor->flags &= ~MF_JUSTATTACKED;
}
@@ -3607,7 +3607,7 @@ void A_SmBounce(mobj_t * actor)
void A_FiredChase(mobj_t * actor)
{
- int weaveindex = actor->special1;
+ int weaveindex = actor->special1.i;
mobj_t *target = actor->target;
angle_t ang;
fixed_t dist;
@@ -3619,7 +3619,7 @@ void A_FiredChase(mobj_t * actor)
// Float up and down
actor->z += FloatBobOffsets[weaveindex];
- actor->special1 = (weaveindex + 2) & 63;
+ actor->special1.i = (weaveindex + 2) & 63;
// Insure it stays above certain height
if (actor->z < actor->floorz + (64 * FRACUNIT))
@@ -3634,13 +3634,13 @@ void A_FiredChase(mobj_t * actor)
}
// Strafe
- if (actor->special2 > 0)
+ if (actor->special2.i > 0)
{
- actor->special2--;
+ actor->special2.i--;
}
else
{
- actor->special2 = 0;
+ actor->special2.i = 0;
actor->momx = actor->momy = 0;
dist = P_AproxDistance(actor->x - target->x, actor->y - target->y);
if (dist < FIREDEMON_ATTACK_RANGE)
@@ -3656,7 +3656,7 @@ void A_FiredChase(mobj_t * actor)
ang >>= ANGLETOFINESHIFT;
actor->momx = FixedMul(8 * FRACUNIT, finecosine[ang]);
actor->momy = FixedMul(8 * FRACUNIT, finesine[ang]);
- actor->special2 = 3; // strafe time
+ actor->special2.i = 3; // strafe time
}
}
}
@@ -3664,7 +3664,7 @@ void A_FiredChase(mobj_t * actor)
FaceMovementDirection(actor);
// Normal movement
- if (!actor->special2)
+ if (!actor->special2.i)
{
if (--actor->movecount < 0 || !P_Move(actor))
{
@@ -3926,14 +3926,14 @@ void A_SorcSpinBalls(mobj_t * actor)
actor->args[0] = 0; // Currently no defense
actor->args[3] = SORC_NORMAL;
actor->args[4] = SORCBALL_INITIAL_SPEED; // Initial orbit speed
- actor->special1 = ANG1;
+ actor->special1.i = ANG1;
z = actor->z - actor->floorclip + actor->info->height;
mo = P_SpawnMobj(actor->x, actor->y, z, MT_SORCBALL1);
if (mo)
{
mo->target = actor;
- mo->special2 = SORCFX4_RAPIDFIRE_TIME;
+ mo->special2.i = SORCFX4_RAPIDFIRE_TIME;
}
mo = P_SpawnMobj(actor->x, actor->y, z, MT_SORCBALL2);
if (mo)
@@ -3955,12 +3955,12 @@ void A_SorcBallOrbit(mobj_t * actor)
int mode = actor->target->args[3];
mobj_t *parent = (mobj_t *) actor->target;
int dist = parent->radius - (actor->radius << 1);
- angle_t prevangle = actor->special1;
+ angle_t prevangle = actor->special1.i;
if (actor->target->health <= 0)
P_SetMobjState(actor, actor->info->painstate);
- baseangle = (angle_t) parent->special1;
+ baseangle = (angle_t) parent->special1.i;
switch (actor->type)
{
case MT_SORCBALL1:
@@ -3993,7 +3993,7 @@ void A_SorcBallOrbit(mobj_t * actor)
A_SorcUpdateBallAngle(actor);
break;
case SORC_STOPPING: // Balls stopping
- if ((parent->special2 == actor->type) &&
+ if ((parent->special2.i == actor->type) &&
(parent->args[1] > SORCBALL_SPEED_ROTATIONS) &&
(abs(angle - (parent->angle >> ANGLETOFINESHIFT)) <
(30 << 5)))
@@ -4005,16 +4005,16 @@ void A_SorcBallOrbit(mobj_t * actor)
switch (actor->type)
{
case MT_SORCBALL1:
- parent->special1 = (int) (parent->angle -
- BALL1_ANGLEOFFSET);
+ parent->special1.i = (int) (parent->angle -
+ BALL1_ANGLEOFFSET);
break;
case MT_SORCBALL2:
- parent->special1 = (int) (parent->angle -
- BALL2_ANGLEOFFSET);
+ parent->special1.i = (int) (parent->angle -
+ BALL2_ANGLEOFFSET);
break;
case MT_SORCBALL3:
- parent->special1 = (int) (parent->angle -
- BALL3_ANGLEOFFSET);
+ parent->special1.i = (int) (parent->angle -
+ BALL3_ANGLEOFFSET);
break;
default:
break;
@@ -4026,7 +4026,7 @@ void A_SorcBallOrbit(mobj_t * actor)
}
break;
case SORC_FIRESPELL: // Casting spell
- if (parent->special2 == actor->type)
+ if (parent->special2.i == actor->type)
{
// Put sorcerer into special throw spell anim
if (parent->health > 0)
@@ -4035,7 +4035,7 @@ void A_SorcBallOrbit(mobj_t * actor)
if (actor->type == MT_SORCBALL1 && P_Random() < 200)
{
S_StartSound(NULL, SFX_SORCERER_SPELLCAST);
- actor->special2 = SORCFX4_RAPIDFIRE_TIME;
+ actor->special2.i = SORCFX4_RAPIDFIRE_TIME;
actor->args[4] = 128;
parent->args[3] = SORC_FIRING_SPELL;
}
@@ -4047,9 +4047,9 @@ void A_SorcBallOrbit(mobj_t * actor)
}
break;
case SORC_FIRING_SPELL:
- if (parent->special2 == actor->type)
+ if (parent->special2.i == actor->type)
{
- if (actor->special2-- <= 0)
+ if (actor->special2.i-- <= 0)
{
// Done rapid firing
parent->args[3] = SORC_STOPPED;
@@ -4075,7 +4075,7 @@ void A_SorcBallOrbit(mobj_t * actor)
// Completed full rotation - make woosh sound
S_StartSound(actor, SFX_SORCERER_BALLWOOSH);
}
- actor->special1 = angle; // Set previous angle
+ actor->special1.i = angle; // Set previous angle
x = parent->x + FixedMul(dist, finecosine[angle]);
y = parent->y + FixedMul(dist, finesine[angle]);
actor->x = x;
@@ -4116,16 +4116,16 @@ void A_StopBalls(mobj_t * actor)
if ((actor->args[0] <= 0) && (chance < 200))
{
- actor->special2 = MT_SORCBALL2; // Blue
+ actor->special2.i = MT_SORCBALL2; // Blue
}
else if ((actor->health < (actor->info->spawnhealth >> 1)) &&
(chance < 200))
{
- actor->special2 = MT_SORCBALL3; // Green
+ actor->special2.i = MT_SORCBALL3; // Green
}
else
{
- actor->special2 = MT_SORCBALL1; // Yellow
+ actor->special2.i = MT_SORCBALL1; // Yellow
}
@@ -4176,7 +4176,7 @@ void A_SorcUpdateBallAngle(mobj_t * actor)
{
if (actor->type == MT_SORCBALL1)
{
- actor->target->special1 += ANG1 * actor->target->args[4];
+ actor->target->special1.i += ANG1 * actor->target->args[4];
}
}
@@ -4265,7 +4265,7 @@ void A_SorcOffense1(mobj_t * actor)
if (mo)
{
mo->target = parent;
- mo->special1 = (int) parent->target;
+ mo->special1.m = parent->target;
mo->args[4] = BOUNCE_TIME_UNIT;
mo->args[3] = 15; // Bounce time in seconds
}
@@ -4273,7 +4273,7 @@ void A_SorcOffense1(mobj_t * actor)
if (mo)
{
mo->target = parent;
- mo->special1 = (int) parent->target;
+ mo->special1.m = parent->target;
mo->args[4] = BOUNCE_TIME_UNIT;
mo->args[3] = 15; // Bounce time in seconds
}
@@ -4298,7 +4298,7 @@ void A_SorcOffense2(mobj_t * actor)
mo = P_SpawnMissileAngle(parent, MT_SORCFX4, ang1, 0);
if (mo)
{
- mo->special2 = 35 * 5 / 2; // 5 seconds
+ mo->special2.i = 35 * 5 / 2; // 5 seconds
dist = P_AproxDistance(dest->x - mo->x, dest->y - mo->y);
dist = dist / mo->info->speed;
if (dist < 1)
@@ -4376,7 +4376,7 @@ void A_SorcFX2Split(mobj_t * actor)
{
mo->target = actor->target;
mo->args[0] = 0; // CW
- mo->special1 = actor->angle; // Set angle
+ mo->special1.i = actor->angle; // Set angle
P_SetMobjStateNF(mo, S_SORCFX2_ORBIT1);
}
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SORCFX2);
@@ -4384,7 +4384,7 @@ void A_SorcFX2Split(mobj_t * actor)
{
mo->target = actor->target;
mo->args[0] = 1; // CCW
- mo->special1 = actor->angle; // Set angle
+ mo->special1.i = actor->angle; // Set angle
P_SetMobjStateNF(mo, S_SORCFX2_ORBIT1);
}
P_SetMobjStateNF(actor, S_NULL);
@@ -4418,8 +4418,8 @@ void A_SorcFX2Orbit(mobj_t * actor)
// Move to new position based on angle
if (actor->args[0]) // Counter clock-wise
{
- actor->special1 += ANG1 * 10;
- angle = ((angle_t) actor->special1) >> ANGLETOFINESHIFT;
+ actor->special1.i += ANG1 * 10;
+ angle = ((angle_t) actor->special1.i) >> ANGLETOFINESHIFT;
x = parent->x + FixedMul(dist, finecosine[angle]);
y = parent->y + FixedMul(dist, finesine[angle]);
z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT * FRACUNIT;
@@ -4429,8 +4429,8 @@ void A_SorcFX2Orbit(mobj_t * actor)
}
else // Clock wise
{
- actor->special1 -= ANG1 * 10;
- angle = ((angle_t) actor->special1) >> ANGLETOFINESHIFT;
+ actor->special1.i -= ANG1 * 10;
+ angle = ((angle_t) actor->special1.i) >> ANGLETOFINESHIFT;
x = parent->x + FixedMul(dist, finecosine[angle]);
y = parent->y + FixedMul(dist, finesine[angle]);
z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT * FRACUNIT;
@@ -4489,7 +4489,7 @@ void A_SorcererBishopEntry(mobj_t * actor)
void A_SorcFX4Check(mobj_t * actor)
{
- if (actor->special2-- <= 0)
+ if (actor->special2.i-- <= 0)
{
P_SetMobjStateNF(actor, actor->info->deathstate);
}
@@ -4507,7 +4507,7 @@ void A_SorcBallPop(mobj_t * actor)
actor->momx = ((P_Random() % 10) - 5) << FRACBITS;
actor->momy = ((P_Random() % 10) - 5) << FRACBITS;
actor->momz = (2 + (P_Random() % 3)) << FRACBITS;
- actor->special2 = 4 * FRACUNIT; // Initial bounce factor
+ actor->special2.i = 4 * FRACUNIT; // Initial bounce factor
actor->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit
actor->args[3] = 5; // Bounce time in seconds
}
@@ -4616,14 +4616,14 @@ void A_FastChase(mobj_t * actor)
}
// Strafe
- if (actor->special2 > 0)
+ if (actor->special2.i > 0)
{
- actor->special2--;
+ actor->special2.i--;
}
else
{
target = actor->target;
- actor->special2 = 0;
+ actor->special2.i = 0;
actor->momx = actor->momy = 0;
dist = P_AproxDistance(actor->x - target->x, actor->y - target->y);
if (dist < CLASS_BOSS_STRAFE_RANGE)
@@ -4639,7 +4639,7 @@ void A_FastChase(mobj_t * actor)
ang >>= ANGLETOFINESHIFT;
actor->momx = FixedMul(13 * FRACUNIT, finecosine[ang]);
actor->momy = FixedMul(13 * FRACUNIT, finesine[ang]);
- actor->special2 = 3; // strafe time
+ actor->special2.i = 3; // strafe time
}
}
}
@@ -4671,7 +4671,7 @@ void A_FastChase(mobj_t * actor)
//
// chase towards player
//
- if (!actor->special2)
+ if (!actor->special2.i)
{
if (--actor->movecount < 0 || !P_Move(actor))
{
@@ -4715,10 +4715,10 @@ void A_ClassBossHealth(mobj_t * actor)
{
if (netgame && !deathmatch) // co-op only
{
- if (!actor->special1)
+ if (!actor->special1.i)
{
actor->health *= 5;
- actor->special1 = true; // has been initialized
+ actor->special1.i = true; // has been initialized
}
}
}
@@ -4800,7 +4800,7 @@ void A_IceSetTics(mobj_t * actor)
void A_IceCheckHeadDone(mobj_t * actor)
{
- if (actor->special2 == 666)
+ if (actor->special2.i == 666)
{
P_SetMobjState(actor, S_ICECHUNK_HEAD2);
}
@@ -4919,7 +4919,7 @@ void A_KoraxChase(mobj_t * actor)
int lastfound;
byte args[3] = { 0, 0, 0 };
- if ((!actor->special2) &&
+ if ((!actor->special2.i) &&
(actor->health <= (actor->info->spawnhealth / 2)))
{
lastfound = 0;
@@ -4930,7 +4930,7 @@ void A_KoraxChase(mobj_t * actor)
}
P_StartACS(249, 0, args, actor, NULL, 0);
- actor->special2 = 1; // Don't run again
+ actor->special2.i = 1; // Don't run again
return;
}
@@ -4951,9 +4951,9 @@ void A_KoraxChase(mobj_t * actor)
{
if (P_Random() < 10)
{
- lastfound = actor->special1;
+ lastfound = actor->special1.i;
spot = P_FindMobjFromTID(KORAX_TELEPORT_TID, &lastfound);
- actor->special1 = lastfound;
+ actor->special1.i = lastfound;
if (spot)
{
P_Teleport(actor, spot->x, spot->y, spot->angle, true);
@@ -5018,22 +5018,22 @@ void KSpiritInit(mobj_t * spirit, mobj_t * korax)
spirit->health = KORAX_SPIRIT_LIFETIME;
- spirit->special1 = (int) korax; // Swarm around korax
- spirit->special2 = 32 + (P_Random() & 7); // Float bob index
+ spirit->special1.m = korax; // Swarm around korax
+ spirit->special2.i = 32 + (P_Random() & 7); // Float bob index
spirit->args[0] = 10; // initial turn value
spirit->args[1] = 0; // initial look angle
// Spawn a tail for spirit
tail = P_SpawnMobj(spirit->x, spirit->y, spirit->z, MT_HOLY_TAIL);
- tail->special2 = (int) spirit; // parent
+ tail->special2.m = spirit; // parent
for (i = 1; i < 3; i++)
{
next = P_SpawnMobj(spirit->x, spirit->y, spirit->z, MT_HOLY_TAIL);
P_SetMobjState(next, next->info->spawnstate + 1);
- tail->special1 = (int) next;
+ tail->special1.m = next;
tail = next;
}
- tail->special1 = 0; // last tail bit
+ tail->special1.m = NULL; // last tail bit
}
void A_KoraxDecide(mobj_t * actor)
@@ -5257,8 +5257,8 @@ void A_KSpiritWeave(mobj_t * actor)
int weaveXY, weaveZ;
int angle;
- weaveXY = actor->special2 >> 16;
- weaveZ = actor->special2 & 0xFFFF;
+ weaveXY = actor->special2.i >> 16;
+ weaveZ = actor->special2.i & 0xFFFF;
angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
newX = actor->x - FixedMul(finecosine[angle],
FloatBobOffsets[weaveXY] << 2);
@@ -5271,7 +5271,7 @@ void A_KSpiritWeave(mobj_t * actor)
actor->z -= FloatBobOffsets[weaveZ] << 1;
weaveZ = (weaveZ + (P_Random() % 5)) & 63;
actor->z += FloatBobOffsets[weaveZ] << 1;
- actor->special2 = weaveZ + (weaveXY << 16);
+ actor->special2.i = weaveZ + (weaveXY << 16);
}
void A_KSpiritSeeker(mobj_t * actor, angle_t thresh, angle_t turnMax)
@@ -5284,7 +5284,7 @@ void A_KSpiritSeeker(mobj_t * actor, angle_t thresh, angle_t turnMax)
fixed_t newZ;
fixed_t deltaZ;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return;
@@ -5348,7 +5348,7 @@ void A_KSpiritRoam(mobj_t * actor)
}
else
{
- if (actor->special1)
+ if (actor->special1.m)
{
A_KSpiritSeeker(actor, actor->args[0] * ANG1,
actor->args[0] * ANG1 * 2);
@@ -5364,7 +5364,7 @@ void A_KSpiritRoam(mobj_t * actor)
void A_KBolt(mobj_t * actor)
{
// Countdown lifetime
- if (actor->special1-- <= 0)
+ if (actor->special1.i-- <= 0)
{
P_SetMobjState(actor, S_NULL);
}
@@ -5387,7 +5387,7 @@ void A_KBoltRaise(mobj_t * actor)
mo = P_SpawnMobj(actor->x, actor->y, z, MT_KORAX_BOLT);
if (mo)
{
- mo->special1 = KORAX_BOLT_LIFETIME;
+ mo->special1.i = KORAX_BOLT_LIFETIME;
}
}
else
diff --git a/src/hexen/p_inter.c b/src/hexen/p_inter.c
index 514d92a6..9e196c79 100644
--- a/src/hexen/p_inter.c
+++ b/src/hexen/p_inter.c
@@ -1286,7 +1286,7 @@ mobj_t *ActiveMinotaur(player_t * master)
starttime = (unsigned int *) mo->args;
if ((leveltime - *starttime) >= MAULATORTICS)
continue;
- plr = ((mobj_t *) mo->special1)->player;
+ plr = mo->special1.m->player;
if (plr == master)
return (mo);
}
@@ -1487,7 +1487,7 @@ void P_KillMobj(mobj_t * source, mobj_t * target)
if (target->type == MT_MINOTAUR)
{
- master = (mobj_t *) target->special1;
+ master = target->special1.m;
if (master->health > 0)
{
if (!ActiveMinotaur(master->player))
@@ -1585,7 +1585,7 @@ boolean P_MorphPlayer(player_t * player)
fog = P_SpawnMobj(x, y, z + TELEFOGHEIGHT, MT_TFOG);
S_StartSound(fog, SFX_TELEPORT);
beastMo = P_SpawnMobj(x, y, z, MT_PIGPLAYER);
- beastMo->special1 = player->readyweapon;
+ beastMo->special1.i = player->readyweapon;
beastMo->angle = angle;
beastMo->player = player;
player->health = beastMo->health = MAXMORPHHEALTH;
@@ -1644,8 +1644,8 @@ boolean P_MorphMonster(mobj_t * actor)
fog = P_SpawnMobj(x, y, z + TELEFOGHEIGHT, MT_TFOG);
S_StartSound(fog, SFX_TELEPORT);
monster = P_SpawnMobj(x, y, z, MT_PIG);
- monster->special2 = moType;
- monster->special1 = MORPHTICS + P_Random();
+ monster->special2.i = moType;
+ monster->special1.i = MORPHTICS + P_Random();
monster->flags |= (oldMonster.flags & MF_SHADOW);
monster->target = oldMonster.target;
monster->angle = oldMonster.angle;
@@ -1657,7 +1657,7 @@ boolean P_MorphMonster(mobj_t * actor)
// check for turning off minotaur power for active icon
if (moType == MT_MINOTAUR)
{
- master = (mobj_t *) oldMonster.special1;
+ master = oldMonster.special1.m;
if (master->health > 0)
{
if (!ActiveMinotaur(master->player))
@@ -1866,7 +1866,7 @@ void P_DamageMobj
damage >>= 1;
break;
case MT_SHARDFX1:
- switch (inflictor->special2)
+ switch (inflictor->special2.i)
{
case 3:
damage <<= 3;
@@ -2036,7 +2036,7 @@ void P_DamageMobj
}
if (source && (source->type == MT_MINOTAUR))
{ // Minotaur's kills go to his master
- master = (mobj_t *) (source->special1);
+ master = source->special1.m;
// Make sure still alive and not a pointer to fighter head
if (master->player && (master->player->mo == master))
{
@@ -2219,7 +2219,7 @@ void P_PoisonDamage(player_t * player, mobj_t * source, int damage,
target->health -= damage;
if (target->health <= 0)
{ // Death
- target->special1 = damage;
+ target->special1.i = damage;
if (player && inflictor && !player->morphTics)
{ // Check for flame death
if ((inflictor->flags2 & MF2_FIREDAMAGE)
diff --git a/src/hexen/p_map.c b/src/hexen/p_map.c
index da5c8824..ddf9c0e4 100644
--- a/src/hexen/p_map.c
+++ b/src/hexen/p_map.c
@@ -410,13 +410,13 @@ boolean PIT_CheckThing(mobj_t * thing)
if (thing->flags2 & MF2_REFLECTIVE
&& (thing->player || thing->flags2 & MF2_BOSS))
{
- tmthing->special1 = (int) tmthing->target;
+ tmthing->special1.m = tmthing->target;
tmthing->target = thing;
return true;
}
if (thing->flags & MF_COUNTKILL || thing->player)
{
- tmthing->special1 = (int) thing;
+ tmthing->special1.m = thing;
}
if (P_Random() < 96)
{
@@ -447,7 +447,7 @@ boolean PIT_CheckThing(mobj_t * thing)
}
if (thing->health <= 0)
{
- tmthing->special1 = 0;
+ tmthing->special1.i = 0;
}
}
return true;
@@ -549,16 +549,15 @@ boolean PIT_CheckThing(mobj_t * thing)
}
if (tmthing->type == MT_LIGHTNING_FLOOR)
{
- if (tmthing->special2
- && !((mobj_t *) tmthing->special2)->special1)
+ if (tmthing->special2.m
+ && !tmthing->special2.m->special1.m)
{
- ((mobj_t *) tmthing->special2)->special1 =
- (int) thing;
+ tmthing->special2.m->special1.m = thing;
}
}
- else if (!tmthing->special1)
+ else if (!tmthing->special1.m)
{
- tmthing->special1 = (int) thing;
+ tmthing->special1.m = thing;
}
}
return true; // lightning zaps through all sprites
@@ -569,21 +568,20 @@ boolean PIT_CheckThing(mobj_t * thing)
if (thing->flags & MF_SHOOTABLE && thing != tmthing->target)
{
- lmo = (mobj_t *) tmthing->special2;
+ lmo = tmthing->special2.m;
if (lmo)
{
if (lmo->type == MT_LIGHTNING_FLOOR)
{
- if (lmo->special2
- && !((mobj_t *) lmo->special2)->special1)
+ if (lmo->special2.m
+ && !lmo->special2.m->special1.m)
{
- ((mobj_t *) lmo->special2)->special1 =
- (int) thing;
+ lmo->special2.m->special1.m = thing;
}
}
- else if (!lmo->special1)
+ else if (!lmo->special1.m)
{
- lmo->special1 = (int) thing;
+ lmo->special1.m = thing;
}
if (!(leveltime & 3))
{
diff --git a/src/hexen/p_maputl.c b/src/hexen/p_maputl.c
index 9e0ece1f..f7790540 100644
--- a/src/hexen/p_maputl.c
+++ b/src/hexen/p_maputl.c
@@ -964,7 +964,7 @@ static mobj_t *RoughBlockCheck(mobj_t * mo, int index)
continue;
}
if ((link->type == MT_MINOTAUR) &&
- (((mobj_t *) link->special1) == mo))
+ (link->special1.m == mo))
{
link = link->bnext;
continue;
@@ -983,7 +983,7 @@ static mobj_t *RoughBlockCheck(mobj_t * mo, int index)
}
else if (mo->type == MT_MINOTAUR) // looking around minotaur
{
- master = (mobj_t *) mo->special1;
+ master = mo->special1.m;
if ((link->flags & MF_COUNTKILL) ||
(link->player && (link != master)))
{
@@ -998,7 +998,7 @@ static mobj_t *RoughBlockCheck(mobj_t * mo, int index)
continue;
}
if ((link->type == MT_MINOTAUR) &&
- (link->special1 == mo->special1))
+ (link->special1.m == mo->special1.m))
{
link = link->bnext;
continue;
diff --git a/src/hexen/p_mobj.c b/src/hexen/p_mobj.c
index ee8f8fd4..388440ac 100644
--- a/src/hexen/p_mobj.c
+++ b/src/hexen/p_mobj.c
@@ -320,14 +320,14 @@ boolean P_SeekerMissile(mobj_t * actor, angle_t thresh, angle_t turnMax)
angle_t angle;
mobj_t *target;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return (false);
}
if (!(target->flags & MF_SHOOTABLE))
{ // Target died
- actor->special1 = 0;
+ actor->special1.m = NULL;
return (false);
}
dir = P_FaceMobj(actor, target, &delta);
@@ -573,7 +573,7 @@ void P_XYMovement(mobj_t * mo)
// mo->momz = -mo->momz;
if (mo->flags2 & MF2_SEEKERMISSILE)
{
- mo->special1 = (int) (mo->target);
+ mo->special1.m = mo->target;
}
mo->target = BlockingMobj;
return;
@@ -983,9 +983,9 @@ void P_BlasterMobjThinker(mobj_t * mobj)
}
P_SpawnMobj(mobj->x, mobj->y, z, MT_MWANDSMOKE);
}
- else if (!--mobj->special1)
+ else if (!--mobj->special1.i)
{
- mobj->special1 = 4;
+ mobj->special1.i = 4;
z = mobj->z - 12 * FRACUNIT;
if (z < mobj->floorz)
{
@@ -1085,7 +1085,7 @@ void P_MobjThinker(mobj_t * mobj)
if (mobj->flags2 & MF2_FLOATBOB)
{ // Floating item bobbing motion (special1 is height)
mobj->z = mobj->floorz +
- mobj->special1 + FloatBobOffsets[(mobj->health++) & 63];
+ mobj->special1.i + FloatBobOffsets[(mobj->health++) & 63];
}
else if ((mobj->z != mobj->floorz) || mobj->momz || BlockingMobj)
{ // Handle Z momentum and gravity
@@ -1592,7 +1592,7 @@ void P_SpawnMapThing(mapthing_t * mthing)
if (mobj->flags2 & MF2_FLOATBOB)
{ // Seed random starting index for bobbing motion
mobj->health = P_Random();
- mobj->special1 = mthing->height << FRACBITS;
+ mobj->special1.i = mthing->height << FRACBITS;
}
if (mobj->tics > 0)
{
diff --git a/src/hexen/p_pspr.c b/src/hexen/p_pspr.c
index 42e8842c..5cb02029 100644
--- a/src/hexen/p_pspr.c
+++ b/src/hexen/p_pspr.c
@@ -756,7 +756,7 @@ void A_FHammerAttack(player_t * player, pspdef_t * psp)
{
P_ThrustMobj(linetarget, angle, power);
}
- pmo->special1 = false; // Don't throw a hammer
+ pmo->special1.i = false; // Don't throw a hammer
goto hammerdone;
}
angle = pmo->angle - i * (ANG45 / 32);
@@ -769,7 +769,7 @@ void A_FHammerAttack(player_t * player, pspdef_t * psp)
{
P_ThrustMobj(linetarget, angle, power);
}
- pmo->special1 = false; // Don't throw a hammer
+ pmo->special1.i = false; // Don't throw a hammer
goto hammerdone;
}
}
@@ -780,17 +780,17 @@ void A_FHammerAttack(player_t * player, pspdef_t * psp)
P_LineAttack(pmo, angle, HAMMER_RANGE, slope, damage);
if (PuffSpawned)
{
- pmo->special1 = false;
+ pmo->special1.i = false;
}
else
{
- pmo->special1 = true;
+ pmo->special1.i = true;
}
hammerdone:
if (player->mana[MANA_2] <
WeaponManaUse[player->class][player->readyweapon])
{ // Don't spawn a hammer if the player doesn't have enough mana
- pmo->special1 = false;
+ pmo->special1.i = false;
}
return;
}
@@ -805,7 +805,7 @@ void A_FHammerThrow(player_t * player, pspdef_t * psp)
{
mobj_t *mo;
- if (!player->mo->special1)
+ if (!player->mo->special1.i)
{
return;
}
@@ -813,7 +813,7 @@ void A_FHammerThrow(player_t * player, pspdef_t * psp)
mo = P_SpawnPlayerMissile(player->mo, MT_HAMMER_MISSILE);
if (mo)
{
- mo->special1 = 0;
+ mo->special1.i = 0;
}
}
@@ -930,25 +930,25 @@ void A_LightningClip(mobj_t * actor)
if (actor->type == MT_LIGHTNING_FLOOR)
{
actor->z = actor->floorz;
- target = (mobj_t *) ((mobj_t *) actor->special2)->special1;
+ target = actor->special2.m->special1.m;
}
else if (actor->type == MT_LIGHTNING_CEILING)
{
actor->z = actor->ceilingz - actor->height;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
}
if (actor->type == MT_LIGHTNING_FLOOR)
{ // floor lightning zig-zags, and forces the ceiling lightning to mimic
- cMo = (mobj_t *) actor->special2;
+ cMo = actor->special2.m;
zigZag = P_Random();
- if ((zigZag > 128 && actor->special1 < 2) || actor->special1 < -2)
+ if ((zigZag > 128 && actor->special1.i < 2) || actor->special1.i < -2)
{
P_ThrustMobj(actor, actor->angle + ANG90, ZAGSPEED);
if (cMo)
{
P_ThrustMobj(cMo, actor->angle + ANG90, ZAGSPEED);
}
- actor->special1++;
+ actor->special1.i++;
}
else
{
@@ -957,7 +957,7 @@ void A_LightningClip(mobj_t * actor)
{
P_ThrustMobj(cMo, cMo->angle - ANG90, ZAGSPEED);
}
- actor->special1--;
+ actor->special1.i--;
}
}
if (target)
@@ -1009,7 +1009,7 @@ void A_LightningZap(mobj_t * actor)
actor->z + deltaZ, MT_LIGHTNING_ZAP);
if (mo)
{
- mo->special2 = (int) actor;
+ mo->special2.m = actor;
mo->momx = actor->momx;
mo->momy = actor->momy;
mo->target = actor->target;
@@ -1028,7 +1028,7 @@ void A_LightningZap(mobj_t * actor)
actor->z+deltaZ, MT_LIGHTNING_ZAP);
if(mo)
{
- mo->special2 = (int)actor;
+ mo->special2.m = actor;
mo->momx = actor->momx;
mo->momy = actor->momy;
mo->target = actor->target;
@@ -1062,14 +1062,14 @@ void A_MLightningAttack2(mobj_t * actor)
cmo = P_SpawnPlayerMissile(actor, MT_LIGHTNING_CEILING);
if (fmo)
{
- fmo->special1 = 0;
- fmo->special2 = (int) cmo;
+ fmo->special1.m = NULL;
+ fmo->special2.m = cmo;
A_LightningZap(fmo);
}
if (cmo)
{
- cmo->special1 = 0; // mobj that it will track
- cmo->special2 = (int) fmo;
+ cmo->special1.m = NULL; // mobj that it will track
+ cmo->special2.m = fmo;
A_LightningZap(cmo);
}
S_StartSound(actor, SFX_MAGE_LIGHTNING_FIRE);
@@ -1097,7 +1097,7 @@ void A_ZapMimic(mobj_t * actor)
{
mobj_t *mo;
- mo = (mobj_t *) actor->special2;
+ mo = actor->special2.m;
if (mo)
{
if (mo->state >= &states[mo->info->deathstate]
@@ -1141,10 +1141,10 @@ void A_LightningRemove(mobj_t * actor)
{
mobj_t *mo;
- mo = (mobj_t *) actor->special2;
+ mo = actor->special2.m;
if (mo)
{
- mo->special2 = 0;
+ mo->special2.m = NULL;
P_ExplodeMissile(mo);
}
}
@@ -1163,7 +1163,7 @@ void MStaffSpawn(mobj_t * pmo, angle_t angle)
if (mo)
{
mo->target = pmo;
- mo->special1 = (int) P_RoughMonsterSearch(mo, 10);
+ mo->special1.m = P_RoughMonsterSearch(mo, 10);
}
}
@@ -1231,8 +1231,8 @@ void A_MStaffWeave(mobj_t * actor)
int weaveXY, weaveZ;
int angle;
- weaveXY = actor->special2 >> 16;
- weaveZ = actor->special2 & 0xFFFF;
+ weaveXY = actor->special2.i >> 16;
+ weaveZ = actor->special2.i & 0xFFFF;
angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
newX = actor->x - FixedMul(finecosine[angle],
FloatBobOffsets[weaveXY] << 2);
@@ -1249,7 +1249,7 @@ void A_MStaffWeave(mobj_t * actor)
{
actor->z = actor->floorz + FRACUNIT;
}
- actor->special2 = weaveZ + (weaveXY << 16);
+ actor->special2.i = weaveZ + (weaveXY << 16);
}
@@ -1261,9 +1261,9 @@ void A_MStaffWeave(mobj_t * actor)
void A_MStaffTrack(mobj_t * actor)
{
- if ((actor->special1 == 0) && (P_Random() < 50))
+ if ((actor->special1.m == NULL) && (P_Random() < 50))
{
- actor->special1 = (int) P_RoughMonsterSearch(actor, 10);
+ actor->special1.m = P_RoughMonsterSearch(actor, 10);
}
P_SeekerMissile(actor, ANG1 * 2, ANG1 * 10);
}
@@ -1283,7 +1283,7 @@ void MStaffSpawn2(mobj_t * actor, angle_t angle)
if (mo)
{
mo->target = actor;
- mo->special1 = (int) P_RoughMonsterSearch(mo, 10);
+ mo->special1.m = P_RoughMonsterSearch(mo, 10);
}
}
@@ -1327,8 +1327,8 @@ void A_FPunchAttack(player_t * player, pspdef_t * psp)
slope = P_AimLineAttack(pmo, angle, 2 * MELEERANGE);
if (linetarget)
{
- player->mo->special1++;
- if (pmo->special1 == 3)
+ player->mo->special1.i++;
+ if (pmo->special1.i == 3)
{
damage <<= 1;
power = 6 * FRACUNIT;
@@ -1346,8 +1346,8 @@ void A_FPunchAttack(player_t * player, pspdef_t * psp)
slope = P_AimLineAttack(pmo, angle, 2 * MELEERANGE);
if (linetarget)
{
- pmo->special1++;
- if (pmo->special1 == 3)
+ pmo->special1.i++;
+ if (pmo->special1.i == 3)
{
damage <<= 1;
power = 6 * FRACUNIT;
@@ -1363,16 +1363,16 @@ void A_FPunchAttack(player_t * player, pspdef_t * psp)
}
}
// didn't find any creatures, so try to strike any walls
- pmo->special1 = 0;
+ pmo->special1.i = 0;
angle = pmo->angle;
slope = P_AimLineAttack(pmo, angle, MELEERANGE);
P_LineAttack(pmo, angle, MELEERANGE, slope, damage);
punchdone:
- if (pmo->special1 == 3)
+ if (pmo->special1.i == 3)
{
- pmo->special1 = 0;
+ pmo->special1.i = 0;
P_SetPsprite(player, ps_weapon, S_PUNCHATK2_1);
S_StartSound(pmo, SFX_FIGHTER_GRUNT);
}
@@ -1441,7 +1441,7 @@ void A_FAxeAttack(player_t * player, pspdef_t * psp)
}
}
// didn't find any creatures, so try to strike any walls
- pmo->special1 = 0;
+ pmo->special1.m = NULL;
angle = pmo->angle;
slope = P_AimLineAttack(pmo, angle, MELEERANGE);
@@ -1499,7 +1499,7 @@ void A_CMaceAttack(player_t * player, pspdef_t * psp)
}
}
// didn't find any creatures, so try to strike any walls
- player->mo->special1 = 0;
+ player->mo->special1.m = NULL;
angle = player->mo->angle;
slope = P_AimLineAttack(player->mo, angle, MELEERANGE);
@@ -1584,12 +1584,12 @@ void A_CStaffAttack(player_t * player, pspdef_t * psp)
mo = P_SPMAngle(pmo, MT_CSTAFF_MISSILE, pmo->angle - (ANG45 / 15));
if (mo)
{
- mo->special2 = 32;
+ mo->special2.i = 32;
}
mo = P_SPMAngle(pmo, MT_CSTAFF_MISSILE, pmo->angle + (ANG45 / 15));
if (mo)
{
- mo->special2 = 0;
+ mo->special2.i = 0;
}
S_StartSound(player->mo, SFX_CLERIC_CSTAFF_FIRE);
}
@@ -1606,7 +1606,7 @@ void A_CStaffMissileSlither(mobj_t * actor)
int weaveXY;
int angle;
- weaveXY = actor->special2;
+ weaveXY = actor->special2.i;
angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
newX = actor->x - FixedMul(finecosine[angle], FloatBobOffsets[weaveXY]);
newY = actor->y - FixedMul(finesine[angle], FloatBobOffsets[weaveXY]);
@@ -1614,7 +1614,7 @@ void A_CStaffMissileSlither(mobj_t * actor)
newX += FixedMul(finecosine[angle], FloatBobOffsets[weaveXY]);
newY += FixedMul(finesine[angle], FloatBobOffsets[weaveXY]);
P_TryMove(actor, newX, newY);
- actor->special2 = weaveXY;
+ actor->special2.i = weaveXY;
}
//============================================================================
@@ -1625,7 +1625,7 @@ void A_CStaffMissileSlither(mobj_t * actor)
void A_CStaffInitBlink(player_t * player, pspdef_t * psp)
{
- player->mo->special1 = (P_Random() >> 1) + 20;
+ player->mo->special1.i = (P_Random() >> 1) + 20;
}
//============================================================================
@@ -1636,10 +1636,10 @@ void A_CStaffInitBlink(player_t * player, pspdef_t * psp)
void A_CStaffCheckBlink(player_t * player, pspdef_t * psp)
{
- if (!--player->mo->special1)
+ if (!--player->mo->special1.i)
{
P_SetPsprite(player, ps_weapon, S_CSTAFFBLINK1);
- player->mo->special1 = (P_Random() + 50) >> 2;
+ player->mo->special1.i = (P_Random() + 50) >> 2;
}
}
@@ -1660,7 +1660,7 @@ void A_CFlameAttack(player_t * player, pspdef_t * psp)
if (mo)
{
mo->thinker.function = P_BlasterMobjThinker;
- mo->special1 = 2;
+ mo->special1.i = 2;
}
player->mana[MANA_2] -= WeaponManaUse[player->class][player->readyweapon];
@@ -1711,9 +1711,9 @@ void A_CFlameMissile(mobj_t * actor)
{
mo->angle = an << ANGLETOFINESHIFT;
mo->target = actor->target;
- mo->momx = mo->special1 =
+ mo->momx = mo->special1.i =
FixedMul(FLAMESPEED, finecosine[an]);
- mo->momy = mo->special2 = FixedMul(FLAMESPEED, finesine[an]);
+ mo->momy = mo->special2.i = FixedMul(FLAMESPEED, finesine[an]);
mo->tics -= P_Random() & 3;
}
mo = P_SpawnMobj(BlockingMobj->x - FixedMul(dist, finecosine[an]),
@@ -1723,9 +1723,9 @@ void A_CFlameMissile(mobj_t * actor)
{
mo->angle = ANG180 + (an << ANGLETOFINESHIFT);
mo->target = actor->target;
- mo->momx = mo->special1 = FixedMul(-FLAMESPEED,
- finecosine[an]);
- mo->momy = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]);
+ mo->momx = mo->special1.i = FixedMul(-FLAMESPEED,
+ finecosine[an]);
+ mo->momy = mo->special2.i = FixedMul(-FLAMESPEED, finesine[an]);
mo->tics -= P_Random() & 3;
}
}
@@ -1790,8 +1790,8 @@ void A_CFlameAttack(player_t *player, pspdef_t *psp)
{
mo->angle = an<<ANGLETOFINESHIFT;
mo->target = pmo;
- mo->momx = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]);
- mo->momy = mo->special2 = FixedMul(FLAMESPEED, finesine[an]);
+ mo->momx = mo->special1.i = FixedMul(FLAMESPEED, finecosine[an]);
+ mo->momy = mo->special2.i = FixedMul(FLAMESPEED, finesine[an]);
mo->tics -= P_Random()&3;
}
mo = P_SpawnMobj(linetarget->x-FixedMul(dist, finecosine[an]),
@@ -1801,9 +1801,9 @@ void A_CFlameAttack(player_t *player, pspdef_t *psp)
{
mo->angle = ANG180+(an<<ANGLETOFINESHIFT);
mo->target = pmo;
- mo->momx = mo->special1 = FixedMul(-FLAMESPEED,
+ mo->momx = mo->special1.i = FixedMul(-FLAMESPEED,
finecosine[an]);
- mo->momy = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]);
+ mo->momy = mo->special2.i = FixedMul(-FLAMESPEED, finesine[an]);
mo->tics -= P_Random()&3;
}
}
@@ -1829,8 +1829,8 @@ void A_CFlameRotate(mobj_t * actor)
int an;
an = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
- actor->momx = actor->special1 + FixedMul(FLAMEROTSPEED, finecosine[an]);
- actor->momy = actor->special2 + FixedMul(FLAMEROTSPEED, finesine[an]);
+ actor->momx = actor->special1.i + FixedMul(FLAMEROTSPEED, finecosine[an]);
+ actor->momy = actor->special2.i + FixedMul(FLAMEROTSPEED, finesine[an]);
actor->angle += ANG90 / 15;
}
@@ -1873,16 +1873,16 @@ void A_CHolyAttack2(mobj_t * actor)
switch (j)
{ // float bob index
case 0:
- mo->special2 = P_Random() & 7; // upper-left
+ mo->special2.i = P_Random() & 7; // upper-left
break;
case 1:
- mo->special2 = 32 + (P_Random() & 7); // upper-right
+ mo->special2.i = 32 + (P_Random() & 7); // upper-right
break;
case 2:
- mo->special2 = (32 + (P_Random() & 7)) << 16; // lower-left
+ mo->special2.i = (32 + (P_Random() & 7)) << 16; // lower-left
break;
case 3:
- mo->special2 =
+ mo->special2.i =
((32 + (P_Random() & 7)) << 16) + 32 + (P_Random() & 7);
break;
}
@@ -1898,20 +1898,20 @@ void A_CHolyAttack2(mobj_t * actor)
}
if (linetarget)
{
- mo->special1 = (int) linetarget;
+ mo->special1.m = linetarget;
mo->flags |= MF_NOCLIP | MF_SKULLFLY;
mo->flags &= ~MF_MISSILE;
}
tail = P_SpawnMobj(mo->x, mo->y, mo->z, MT_HOLY_TAIL);
- tail->special2 = (int) mo; // parent
+ tail->special2.m = mo; // parent
for (i = 1; i < 3; i++)
{
next = P_SpawnMobj(mo->x, mo->y, mo->z, MT_HOLY_TAIL);
P_SetMobjState(next, next->info->spawnstate + 1);
- tail->special1 = (int) next;
+ tail->special1.m = next;
tail = next;
}
- tail->special1 = 0; // last tail bit
+ tail->special1.m = NULL; // last tail bit
}
}
@@ -1973,7 +1973,7 @@ static void CHolyFindTarget(mobj_t * actor)
target = P_RoughMonsterSearch(actor, 6);
if (target != NULL)
{
- actor->special1 = (int) target;
+ actor->special1.m = target;
actor->flags |= MF_NOCLIP | MF_SKULLFLY;
actor->flags &= ~MF_MISSILE;
}
@@ -1997,7 +1997,7 @@ static void CHolySeekerMissile(mobj_t * actor, angle_t thresh,
fixed_t newZ;
fixed_t deltaZ;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return;
@@ -2005,7 +2005,7 @@ static void CHolySeekerMissile(mobj_t * actor, angle_t thresh,
if (!(target->flags & MF_SHOOTABLE)
|| (!(target->flags & MF_COUNTKILL) && !target->player))
{ // Target died/target isn't a player or creature
- actor->special1 = 0;
+ actor->special1.m = NULL;
actor->flags &= ~(MF_NOCLIP | MF_SKULLFLY);
actor->flags |= MF_MISSILE;
CHolyFindTarget(actor);
@@ -2071,8 +2071,8 @@ static void CHolyWeave(mobj_t * actor)
int weaveXY, weaveZ;
int angle;
- weaveXY = actor->special2 >> 16;
- weaveZ = actor->special2 & 0xFFFF;
+ weaveXY = actor->special2.i >> 16;
+ weaveZ = actor->special2.i & 0xFFFF;
angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
newX = actor->x - FixedMul(finecosine[angle],
FloatBobOffsets[weaveXY] << 2);
@@ -2085,7 +2085,7 @@ static void CHolyWeave(mobj_t * actor)
actor->z -= FloatBobOffsets[weaveZ] << 1;
weaveZ = (weaveZ + (P_Random() % 5)) & 63;
actor->z += FloatBobOffsets[weaveZ] << 1;
- actor->special2 = weaveZ + (weaveXY << 16);
+ actor->special2.i = weaveZ + (weaveXY << 16);
}
//============================================================================
@@ -2106,7 +2106,7 @@ void A_CHolySeek(mobj_t * actor)
actor->tics -= P_Random() & 3;
return;
}
- if (actor->special1)
+ if (actor->special1.m)
{
CHolySeekerMissile(actor, actor->args[0] * ANG1,
actor->args[0] * ANG1 * 2);
@@ -2130,7 +2130,7 @@ static void CHolyTailFollow(mobj_t * actor, fixed_t dist)
int an;
fixed_t oldDistance, newDistance;
- child = (mobj_t *) actor->special1;
+ child = actor->special1.m;
if (child)
{
an = R_PointToAngle2(actor->x, actor->y, child->x,
@@ -2175,7 +2175,7 @@ static void CHolyTailRemove(mobj_t * actor)
{
mobj_t *child;
- child = (mobj_t *) actor->special1;
+ child = actor->special1.m;
if (child)
{
CHolyTailRemove(child);
@@ -2193,7 +2193,7 @@ void A_CHolyTail(mobj_t * actor)
{
mobj_t *parent;
- parent = (mobj_t *) actor->special2;
+ parent = actor->special2.m;
if (parent)
{
@@ -2230,7 +2230,7 @@ void A_CHolyCheckScream(mobj_t * actor)
{
S_StartSound(actor, SFX_SPIRIT_ACTIVE);
}
- if (!actor->special1)
+ if (!actor->special1.m)
{
CHolyFindTarget(actor);
}
@@ -2292,9 +2292,9 @@ void A_FireConePL1(player_t * player, pspdef_t * psp)
mo = P_SpawnPlayerMissile(pmo, MT_SHARDFX1);
if (mo)
{
- mo->special1 = SHARDSPAWN_LEFT | SHARDSPAWN_DOWN | SHARDSPAWN_UP
+ mo->special1.i = SHARDSPAWN_LEFT | SHARDSPAWN_DOWN | SHARDSPAWN_UP
| SHARDSPAWN_RIGHT;
- mo->special2 = 3; // Set sperm count (levels of reproductivity)
+ mo->special2.i = 3; // Set sperm count (levels of reproductivity)
mo->target = pmo;
mo->args[0] = 3; // Mark Initial shard as super damage
}
@@ -2304,12 +2304,12 @@ void A_FireConePL1(player_t * player, pspdef_t * psp)
void A_ShedShard(mobj_t * actor)
{
mobj_t *mo;
- int spawndir = actor->special1;
- int spermcount = actor->special2;
+ int spawndir = actor->special1.i;
+ int spermcount = actor->special2.i;
if (spermcount <= 0)
return; // No sperm left
- actor->special2 = 0;
+ actor->special2.i = 0;
spermcount--;
// every so many calls, spawn a new missile in it's set directions
@@ -2320,8 +2320,8 @@ void A_ShedShard(mobj_t * actor)
(20 + 2 * spermcount) << FRACBITS);
if (mo)
{
- mo->special1 = SHARDSPAWN_LEFT;
- mo->special2 = spermcount;
+ mo->special1.i = SHARDSPAWN_LEFT;
+ mo->special2.i = spermcount;
mo->momz = actor->momz;
mo->target = actor->target;
mo->args[0] = (spermcount == 3) ? 2 : 0;
@@ -2334,8 +2334,8 @@ void A_ShedShard(mobj_t * actor)
(20 + 2 * spermcount) << FRACBITS);
if (mo)
{
- mo->special1 = SHARDSPAWN_RIGHT;
- mo->special2 = spermcount;
+ mo->special1.i = SHARDSPAWN_RIGHT;
+ mo->special2.i = spermcount;
mo->momz = actor->momz;
mo->target = actor->target;
mo->args[0] = (spermcount == 3) ? 2 : 0;
@@ -2350,11 +2350,11 @@ void A_ShedShard(mobj_t * actor)
mo->momz = actor->momz;
mo->z += 8 * FRACUNIT;
if (spermcount & 1) // Every other reproduction
- mo->special1 =
+ mo->special1.i =
SHARDSPAWN_UP | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
else
- mo->special1 = SHARDSPAWN_UP;
- mo->special2 = spermcount;
+ mo->special1.i = SHARDSPAWN_UP;
+ mo->special2.i = spermcount;
mo->target = actor->target;
mo->args[0] = (spermcount == 3) ? 2 : 0;
}
@@ -2368,11 +2368,11 @@ void A_ShedShard(mobj_t * actor)
mo->momz = actor->momz;
mo->z -= 4 * FRACUNIT;
if (spermcount & 1) // Every other reproduction
- mo->special1 =
+ mo->special1.i =
SHARDSPAWN_DOWN | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
else
- mo->special1 = SHARDSPAWN_DOWN;
- mo->special2 = spermcount;
+ mo->special1.i = SHARDSPAWN_DOWN;
+ mo->special2.i = spermcount;
mo->target = actor->target;
mo->args[0] = (spermcount == 3) ? 2 : 0;
}
diff --git a/src/hexen/p_things.c b/src/hexen/p_things.c
index db0d89cc..5e137100 100644
--- a/src/hexen/p_things.c
+++ b/src/hexen/p_things.c
@@ -273,7 +273,7 @@ boolean EV_ThingSpawn(byte * args, boolean fog)
newMobj->flags2 |= MF2_DROPPED; // Don't respawn
if (newMobj->flags2 & MF2_FLOATBOB)
{
- newMobj->special1 = newMobj->z - newMobj->floorz;
+ newMobj->special1.i = newMobj->z - newMobj->floorz;
}
success = true;
}
diff --git a/src/hexen/p_user.c b/src/hexen/p_user.c
index 9f4e285c..dd64315d 100644
--- a/src/hexen/p_user.c
+++ b/src/hexen/p_user.c
@@ -435,14 +435,14 @@ void P_DeathThink(player_t * player)
newtorchdelta = 0;
}
player->playerstate = PST_REBORN;
- player->mo->special1 = player->class;
- if (player->mo->special1 > 2)
+ player->mo->special1.i = player->class;
+ if (player->mo->special1.i > 2)
{
- player->mo->special1 = 0;
+ player->mo->special1.i = 0;
}
// Let the mobj know the player has entered the reborn state. Some
// mobjs need to know when it's ok to remove themselves.
- player->mo->special2 = 666;
+ player->mo->special2.i = 666;
}
}
@@ -526,7 +526,7 @@ boolean P_UndoPlayerMorph(player_t * player)
y = pmo->y;
z = pmo->z;
angle = pmo->angle;
- weapon = pmo->special1;
+ weapon = pmo->special1.i;
oldFlags = pmo->flags;
oldFlags2 = pmo->flags2;
oldBeast = pmo->type;
@@ -554,7 +554,7 @@ boolean P_UndoPlayerMorph(player_t * player)
mo = P_SpawnMobj(x, y, z, oldBeast);
mo->angle = angle;
mo->health = player->health;
- mo->special1 = weapon;
+ mo->special1.i = weapon;
mo->player = player;
mo->flags = oldFlags;
mo->flags2 = oldFlags2;
@@ -694,10 +694,10 @@ void P_PlayerThink(player_t * player)
speedMo->flags |= playerNum << MF_TRANSSHIFT;
}
speedMo->target = pmo;
- speedMo->special1 = player->class;
- if (speedMo->special1 > 2)
+ speedMo->special1.i = player->class;
+ if (speedMo->special1.i > 2)
{
- speedMo->special1 = 0;
+ speedMo->special1.i = 0;
}
speedMo->sprite = pmo->sprite;
speedMo->floorclip = pmo->floorclip;
@@ -1144,7 +1144,7 @@ void P_BlastMobj(mobj_t * source, mobj_t * victim, fixed_t strength)
return;
break;
case MT_MSTAFF_FX2: // Reflect to originator
- victim->special1 = (int) victim->target;
+ victim->special1.m = victim->target;
victim->target = source;
break;
default:
@@ -1153,9 +1153,9 @@ void P_BlastMobj(mobj_t * source, mobj_t * victim, fixed_t strength)
}
if (victim->type == MT_HOLY_FX)
{
- if ((mobj_t *) (victim->special1) == source)
+ if (victim->special1.m == source)
{
- victim->special1 = (int) victim->target;
+ victim->special1.m = victim->target;
victim->target = source;
}
}
@@ -1521,7 +1521,7 @@ boolean P_UseArtifact(player_t * player, artitype_t arti)
if (mo)
{
mo->target = player->mo;
- mo->special1 = (int) (player->mo);
+ mo->special1.m = (player->mo);
mo->momz = 5 * FRACUNIT;
}
break;
diff --git a/src/hexen/r_things.c b/src/hexen/r_things.c
index aeba11c4..e59c7053 100644
--- a/src/hexen/r_things.c
+++ b/src/hexen/r_things.c
@@ -577,7 +577,7 @@ void R_ProjectSprite(mobj_t * thing)
}
else
{
- vis->class = thing->special1;
+ vis->class = thing->special1.i;
}
if (vis->class > 2)
{
diff --git a/src/hexen/sv_save.c b/src/hexen/sv_save.c
index 63b0190b..bafa89d7 100644
--- a/src/hexen/sv_save.c
+++ b/src/hexen/sv_save.c
@@ -1040,11 +1040,11 @@ static void MangleMobj(mobj_t * mobj)
case MT_MSTAFF_FX2:
if (corpse)
{
- mobj->special1 = MOBJ_NULL;
+ mobj->special1.m = MOBJ_NULL;
}
else
{
- mobj->special1 = GetMobjNum((mobj_t *) mobj->special1);
+ mobj->special1.m = GetMobjNum(mobj->special1.m);
}
break;
@@ -1053,11 +1053,11 @@ static void MangleMobj(mobj_t * mobj)
case MT_LIGHTNING_ZAP:
if (corpse)
{
- mobj->special2 = MOBJ_NULL;
+ mobj->special2.m = MOBJ_NULL;
}
else
{
- mobj->special2 = GetMobjNum((mobj_t *) mobj->special2);
+ mobj->special2.m = GetMobjNum(mobj->special2.m);
}
break;
@@ -1066,19 +1066,19 @@ static void MangleMobj(mobj_t * mobj)
case MT_LIGHTNING_CEILING:
if (corpse)
{
- mobj->special1 = MOBJ_NULL;
- mobj->special2 = MOBJ_NULL;
+ mobj->special1.m = MOBJ_NULL;
+ mobj->special2.m = MOBJ_NULL;
}
else
{
- mobj->special1 = GetMobjNum((mobj_t *) mobj->special1);
- mobj->special2 = GetMobjNum((mobj_t *) mobj->special2);
+ mobj->special1.m = GetMobjNum(mobj->special1.m);
+ mobj->special2.m = GetMobjNum(mobj->special2.m);
}
break;
// Miscellaneous
case MT_KORAX:
- mobj->special1 = 0; // Searching index
+ mobj->special1.i = 0; // Searching index
break;
default:
@@ -1134,20 +1134,20 @@ static void RestoreMobj(mobj_t * mobj)
case MT_THRUSTFLOOR_DOWN:
case MT_MINOTAUR:
case MT_SORCFX1:
- SetMobjPtr(&mobj->special1);
+ SetMobjPtr(&mobj->special1.i);
break;
// Just special2
case MT_LIGHTNING_FLOOR:
case MT_LIGHTNING_ZAP:
- SetMobjPtr(&mobj->special2);
+ SetMobjPtr(&mobj->special2.i);
break;
// Both special1 and special2
case MT_HOLY_TAIL:
case MT_LIGHTNING_CEILING:
- SetMobjPtr(&mobj->special1);
- SetMobjPtr(&mobj->special2);
+ SetMobjPtr(&mobj->special1.i);
+ SetMobjPtr(&mobj->special2.i);
break;
default: