mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
- 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.
This commit is contained in:
parent
e9b23cf833
commit
500bc2b852
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue