summaryrefslogtreecommitdiff
path: root/src/hexen/a_action.c
diff options
context:
space:
mode:
authorSimon Howard2011-09-25 23:46:08 +0000
committerSimon Howard2011-09-25 23:46:08 +0000
commitfcb27f12ee85d068e6b07fccc102ddf70c153c1f (patch)
treed2a5a3f36cfda24ed9262ae67943bba8d8fecbe1 /src/hexen/a_action.c
parent0ea5739881d540d5e5d8007917ee7e17d68a57be (diff)
downloadchocolate-doom-fcb27f12ee85d068e6b07fccc102ddf70c153c1f.tar.gz
chocolate-doom-fcb27f12ee85d068e6b07fccc102ddf70c153c1f.tar.bz2
chocolate-doom-fcb27f12ee85d068e6b07fccc102ddf70c153c1f.zip
Fix special1/special2 values in Hexen code so that they can properly
hold pointer values. Subversion-branch: /branches/v2-branch Subversion-revision: 2407
Diffstat (limited to 'src/hexen/a_action.c')
-rw-r--r--src/hexen/a_action.c78
1 files changed, 39 insertions, 39 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)
{