From 500bc2b852de14928696e7d7eccd86317e3ab16a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 20 Jan 2016 11:39:41 +0100 Subject: [PATCH] - fixed two refactoring errors: * A_BridgeOrbit had its radius as an int, not a fixed_t. * PIT_CheckThing used the wrong coordinate for checking actor distance. --- src/g_shared/a_bridge.cpp | 4 ++-- src/p_map.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/g_shared/a_bridge.cpp b/src/g_shared/a_bridge.cpp index eed95d8d2a..27dbb0c6b6 100644 --- a/src/g_shared/a_bridge.cpp +++ b/src/g_shared/a_bridge.cpp @@ -100,14 +100,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_BridgeOrbit) // Set default values // Every five tics, Hexen moved the ball 3/256th of a revolution. int rotationspeed = ANGLE_45/32*3/5; - int rotationradius = ORBIT_RADIUS; + int rotationradius = ORBIT_RADIUS * FRACUNIT; // If the bridge is custom, set non-default values if any. // Set angular speed; 1--128: counterclockwise rotation ~=1--180°; 129--255: clockwise rotation ~= 180--1° if (self->target->args[3] > 128) rotationspeed = ANGLE_45/32 * (self->target->args[3]-256) / TICRATE; else if (self->target->args[3] > 0) rotationspeed = ANGLE_45/32 * (self->target->args[3]) / TICRATE; // Set rotation radius - if (self->target->args[4]) rotationradius = ((self->target->args[4] * self->target->radius) / (100 * FRACUNIT)); + if (self->target->args[4]) rotationradius = ((self->target->args[4] * self->target->radius) / 100); self->angle += rotationspeed; self->SetOrigin(self->target->Vec3Angle(rotationradius, self->angle, 0), true); diff --git a/src/p_map.cpp b/src/p_map.cpp index 259becd677..364656d24d 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1034,7 +1034,7 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) fixedvec3 thingpos = thing->PosRelative(tm.thing); fixed_t blockdist = thing->radius + tm.thing->radius; - if (abs(thingpos.x - tm.thing->X()) >= blockdist || abs(thingpos.y - tm.thing->Y()) >= blockdist) + if (abs(thingpos.x - tm.x) >= blockdist || abs(thingpos.y - tm.y) >= blockdist) return true; if ((thing->flags2 | tm.thing->flags2) & MF2_THRUACTORS) @@ -1087,7 +1087,7 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) if (newdist > olddist) { // ... but not if they did not overlap in z-direction before but would after the move. - unblocking = !((tm.thing->Z() >= thingpos.z + thing->height && tm.z < thingpos.z + thing->height) || + unblocking = !((tm.thing->Z() >= topz && tm.z < topz) || (tm.thing->Top() <= thingpos.z && tm.thing->Top() > thingpos.z)); } }