summaryrefslogtreecommitdiff
path: root/src/p_doors.c
diff options
context:
space:
mode:
authorSimon Howard2009-11-21 01:16:14 +0000
committerSimon Howard2009-11-21 01:16:14 +0000
commit3cf74a97261b1a0aceb591b495b0857781918edd (patch)
tree28caae31dc6d338310998b2cd8855ca6a16e9c3d /src/p_doors.c
parent299e1c5abf804e2e249c4f77b82fb7949a3f9d7b (diff)
parent892ad7c072a6717e8935053d7837a33974d0d824 (diff)
downloadchocolate-doom-3cf74a97261b1a0aceb591b495b0857781918edd.tar.gz
chocolate-doom-3cf74a97261b1a0aceb591b495b0857781918edd.tar.bz2
chocolate-doom-3cf74a97261b1a0aceb591b495b0857781918edd.zip
Merge from trunk.
Subversion-branch: /branches/opl-branch Subversion-revision: 1734
Diffstat (limited to 'src/p_doors.c')
-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;
}