ref: fcb27f12ee85d068e6b07fccc102ddf70c153c1f
parent: 0ea5739881d540d5e5d8007917ee7e17d68a57be
author: Simon Howard <[email protected]>
date: Sun Sep 25 19:46:08 EDT 2011
Fix special1/special2 values in Hexen code so that they can properly hold pointer values. Subversion-branch: /branches/v2-branch Subversion-revision: 2407
--- a/src/hexen/a_action.c
+++ b/src/hexen/a_action.c
@@ -311,7 +311,7 @@
{
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_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 A_BridgeOrbit(mobj_t * actor)
{
- if (actor->target->special1)
+ if (actor->target->special1.i)
{
P_SetMobjState(actor, S_NULL);
}
@@ -438,7 +438,7 @@
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_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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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_PoisonBagCheck(mobj_t * actor)
{
- if (!--actor->special1)
+ if (!--actor->special1.i)
{
P_SetMobjState(actor, S_POISONCLOUD_X1);
}
@@ -797,9 +797,9 @@
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 @@
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 @@
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 @@
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 @@
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_CheckTeleRing(mobj_t * actor)
{
- if (actor->special1-- <= 0)
+ if (actor->special1.i-- <= 0)
{
P_SetMobjState(actor, actor->info->deathstate);
}
@@ -1087,24 +1087,24 @@
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 @@
}
// 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_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 @@
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 @@
{
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 @@
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)
{
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -1051,7 +1051,7 @@
if (player->morphTics)
{
- player->readyweapon = player->mo->special1; // Restore weapon
+ player->readyweapon = player->mo->special1.i; // Restore weapon
player->morphTics = 0;
}
player->messageTics = 0;
--- a/src/hexen/h2def.h
+++ b/src/hexen/h2def.h
@@ -172,6 +172,13 @@
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 @@
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
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -502,7 +502,7 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
&& 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 @@
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 @@
// 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_CheckSkullDone(mobj_t * actor)
{
- if (actor->special2 == 666)
+ if (actor->special2.i == 666)
{
P_SetMobjState(actor, S_BLOODYSKULLX2);
}
@@ -1804,7 +1804,7 @@
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 @@
P_DamageMobj(actor->target, actor, actor, HITDICE(4));
return;
}
- actor->special1 = (P_Random() & 3) + 5;
+ actor->special1.i = (P_Random() & 3) + 5;
}
//============================================================================
@@ -2592,9 +2592,9 @@
{
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;
}
@@ -2601,10 +2601,10 @@
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 @@
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 @@
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_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 @@
{
mobj_t *mo;
- if (!--actor->special1)
+ if (!--actor->special1.i)
{
actor->momx = 0;
actor->momy = 0;
@@ -2727,9 +2727,9 @@
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 @@
angle_t angleToSpot, angleToTarget;
mobj_t *mo;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return;
@@ -2887,8 +2887,8 @@
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 @@
}
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,7 +2918,7 @@
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);
@@ -2925,7 +2925,7 @@
return;
}
}
- while (actor->special1 == (int) actor);
+ while (actor->special1.m == actor);
P_RemoveMobjFromTIDList(actor);
}
@@ -3035,7 +3035,7 @@
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 @@
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 @@
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_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 @@
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_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 @@
// 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 @@
}
// 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 @@
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 @@
FaceMovementDirection(actor);
// Normal movement
- if (!actor->special2)
+ if (!actor->special2.i)
{
if (--actor->movecount < 0 || !P_Move(actor))
{
@@ -3926,7 +3926,7 @@
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);
@@ -3933,7 +3933,7 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
// 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 @@
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 @@
{
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 @@
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 @@
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 @@
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 @@
{
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 @@
{
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 @@
// 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 @@
}
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_SorcFX4Check(mobj_t * actor)
{
- if (actor->special2-- <= 0)
+ if (actor->special2.i-- <= 0)
{
P_SetMobjStateNF(actor, actor->info->deathstate);
}
@@ -4507,7 +4507,7 @@
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 @@
}
// 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 @@
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 @@
//
// chase towards player
//
- if (!actor->special2)
+ if (!actor->special2.i)
{
if (--actor->movecount < 0 || !P_Move(actor))
{
@@ -4715,10 +4715,10 @@
{
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_IceCheckHeadDone(mobj_t * actor)
{
- if (actor->special2 == 666)
+ if (actor->special2.i == 666)
{
P_SetMobjState(actor, S_ICECHUNK_HEAD2);
}
@@ -4919,7 +4919,7 @@
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 @@
}
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 @@
{
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 @@
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 @@
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 @@
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 @@
fixed_t newZ;
fixed_t deltaZ;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return;
@@ -5348,7 +5348,7 @@
}
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_KBolt(mobj_t * actor)
{
// Countdown lifetime
- if (actor->special1-- <= 0)
+ if (actor->special1.i-- <= 0)
{
P_SetMobjState(actor, S_NULL);
}
@@ -5387,7 +5387,7 @@
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
--- a/src/hexen/p_inter.c
+++ b/src/hexen/p_inter.c
@@ -1286,7 +1286,7 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
damage >>= 1;
break;
case MT_SHARDFX1:
- switch (inflictor->special2)
+ switch (inflictor->special2.i)
{
case 3:
damage <<= 3;
@@ -2036,7 +2036,7 @@
}
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 @@
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)
--- a/src/hexen/p_map.c
+++ b/src/hexen/p_map.c
@@ -410,13 +410,13 @@
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 @@
}
if (thing->health <= 0)
{
- tmthing->special1 = 0;
+ tmthing->special1.i = 0;
}
}
return true;
@@ -549,16 +549,15 @@
}
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 @@
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))
{
--- a/src/hexen/p_maputl.c
+++ b/src/hexen/p_maputl.c
@@ -964,7 +964,7 @@
continue;
}
if ((link->type == MT_MINOTAUR) &&
- (((mobj_t *) link->special1) == mo))
+ (link->special1.m == mo))
{
link = link->bnext;
continue;
@@ -983,7 +983,7 @@
}
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 @@
continue;
}
if ((link->type == MT_MINOTAUR) &&
- (link->special1 == mo->special1))
+ (link->special1.m == mo->special1.m))
{
link = link->bnext;
continue;
--- a/src/hexen/p_mobj.c
+++ b/src/hexen/p_mobj.c
@@ -320,7 +320,7 @@
angle_t angle;
mobj_t *target;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return (false);
@@ -327,7 +327,7 @@
}
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 @@
// 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 @@
}
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 @@
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 @@
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)
{
--- a/src/hexen/p_pspr.c
+++ b/src/hexen/p_pspr.c
@@ -756,7 +756,7 @@
{
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 @@
{
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 @@
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 @@
{
mobj_t *mo;
- if (!player->mo->special1)
+ if (!player->mo->special1.i)
{
return;
}
@@ -813,7 +813,7 @@
mo = P_SpawnPlayerMissile(player->mo, MT_HAMMER_MISSILE);
if (mo)
{
- mo->special1 = 0;
+ mo->special1.i = 0;
}
}
@@ -930,18 +930,18 @@
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)
@@ -948,7 +948,7 @@
{
P_ThrustMobj(cMo, actor->angle + ANG90, ZAGSPEED);
}
- actor->special1++;
+ actor->special1.i++;
}
else
{
@@ -957,7 +957,7 @@
{
P_ThrustMobj(cMo, cMo->angle - ANG90, ZAGSPEED);
}
- actor->special1--;
+ actor->special1.i--;
}
}
if (target)
@@ -1009,7 +1009,7 @@
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 @@
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 @@
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 @@
{
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 @@
{
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 @@
if (mo)
{
mo->target = pmo;
- mo->special1 = (int) P_RoughMonsterSearch(mo, 10);
+ mo->special1.m = P_RoughMonsterSearch(mo, 10);
}
}
@@ -1231,8 +1231,8 @@
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 @@
{
actor->z = actor->floorz + FRACUNIT;
}
- actor->special2 = weaveZ + (weaveXY << 16);
+ actor->special2.i = weaveZ + (weaveXY << 16);
}
@@ -1261,9 +1261,9 @@
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 @@
if (mo)
{
mo->target = actor;
- mo->special1 = (int) P_RoughMonsterSearch(mo, 10);
+ mo->special1.m = P_RoughMonsterSearch(mo, 10);
}
}
@@ -1327,8 +1327,8 @@
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 @@
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,7 +1363,7 @@
}
}
// 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);
@@ -1370,9 +1370,9 @@
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 @@
}
}
// 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 @@
}
}
// 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 @@
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 @@
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 @@
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_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_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 @@
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
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 @@
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 @@
}
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 @@
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 @@
fixed_t newZ;
fixed_t deltaZ;
- target = (mobj_t *) actor->special1;
+ target = actor->special1.m;
if (target == NULL)
{
return;
@@ -2005,7 +2005,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
{
mobj_t *child;
- child = (mobj_t *) actor->special1;
+ child = actor->special1.m;
if (child)
{
CHolyTailRemove(child);
@@ -2193,7 +2193,7 @@
{
mobj_t *parent;
- parent = (mobj_t *) actor->special2;
+ parent = actor->special2.m;
if (parent)
{
@@ -2230,7 +2230,7 @@
{
S_StartSound(actor, SFX_SPIRIT_ACTIVE);
}
- if (!actor->special1)
+ if (!actor->special1.m)
{
CHolyFindTarget(actor);
}
@@ -2292,9 +2292,9 @@
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_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 @@
(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 @@
(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 @@
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 @@
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;
}
--- a/src/hexen/p_things.c
+++ b/src/hexen/p_things.c
@@ -273,7 +273,7 @@
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;
}
--- a/src/hexen/p_user.c
+++ b/src/hexen/p_user.c
@@ -435,14 +435,14 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
if (mo)
{
mo->target = player->mo;
- mo->special1 = (int) (player->mo);
+ mo->special1.m = (player->mo);
mo->momz = 5 * FRACUNIT;
}
break;
--- a/src/hexen/r_things.c
+++ b/src/hexen/r_things.c
@@ -577,7 +577,7 @@
}
else
{
- vis->class = thing->special1;
+ vis->class = thing->special1.i;
}
if (vis->class > 2)
{
--- a/src/hexen/sv_save.c
+++ b/src/hexen/sv_save.c
@@ -1040,11 +1040,11 @@
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 @@
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 @@
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 @@
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: