summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2009-10-05 20:25:53 +0000
committerSimon Howard2009-10-05 20:25:53 +0000
commita91a40f18eb3a353025b21bf22599c30f65a1cd3 (patch)
tree8fd8d4b71ce7b04d043cff7612675bfcebd1d367
parent55789cf12de42cc893bd903f84435ed90015dd4a (diff)
downloadchocolate-doom-a91a40f18eb3a353025b21bf22599c30f65a1cd3.tar.gz
chocolate-doom-a91a40f18eb3a353025b21bf22599c30f65a1cd3.tar.bz2
chocolate-doom-a91a40f18eb3a353025b21bf22599c30f65a1cd3.zip
Fix desync in ep1-0500.lmp on 64-bit (thanks exp(x)).
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1710
-rw-r--r--src/p_doors.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/p_doors.c b/src/p_doors.c
index b681a8d0..89b65328 100644
--- a/src/p_doors.c
+++ b/src/p_doors.c
@@ -420,8 +420,41 @@ EV_VerticalDoor
{
if (!thing->player)
return; // JDC: bad guys never close doors
-
- door->direction = -1; // start going down immediately
+
+ // When is a door not a door?
+ // In Vanilla, door->direction is set, even though
+ // "specialdata" might not actually point at a door.
+
+ if (door->thinker.function.acp1 == (actionf_p1) T_VerticalDoor)
+ {
+ door->direction = -1; // start going down immediately
+ }
+ else if (door->thinker.function.acp1 == (actionf_p1) T_PlatRaise)
+ {
+ // Erm, this is a plat, not a door.
+ // This notably causes a problem in ep1-0500.lmp where
+ // a plat and a door are cross-referenced; the door
+ // doesn't open on 64-bit.
+ // The direction field in vldoor_t corresponds to the wait
+ // field in plat_t. Let's set that to -1 instead.
+
+ plat_t *plat;
+
+ plat = (plat_t *) door;
+ plat->wait = -1;
+ }
+ else
+ {
+ // This isn't a door OR a plat. Now we're in trouble.
+
+ fprintf(stderr, "EV_VerticalDoor: Tried to close "
+ "something that wasn't a door.\n");
+
+ // Try closing it anyway. At least it will work on 32-bit
+ // machines.
+
+ door->direction = -1;
+ }
}
return;
}