From fcb27f12ee85d068e6b07fccc102ddf70c153c1f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 25 Sep 2011 23:46:08 +0000 Subject: Fix special1/special2 values in Hexen code so that they can properly hold pointer values. Subversion-branch: /branches/v2-branch Subversion-revision: 2407 --- src/hexen/p_map.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'src/hexen/p_map.c') 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)) { -- cgit v1.2.3