mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- Fixed: P_CheckOnMobjZ returned the first thing an actor could stand on,
not the highest possible. SVN r290 (trunk)
This commit is contained in:
parent
7f93ab05ee
commit
8ecfe6a8ac
3 changed files with 13 additions and 5 deletions
|
@ -1,4 +1,6 @@
|
|||
August 11, 2006 (Changes by Graf Zahl)
|
||||
- Fixed: P_CheckOnMobjZ returned the first thing an actor could stand on,
|
||||
not the highest possible.
|
||||
- Added disintegration damage to SectorDamage.
|
||||
- Bumped savegame version, min. savegame version, netgame version and
|
||||
demo version because the inventory and damage changes are incompatible
|
||||
|
|
|
@ -277,7 +277,7 @@ extern bool DoRipping;
|
|||
extern AActor *LastRipped;
|
||||
|
||||
BOOL P_TestMobjLocation (AActor *mobj);
|
||||
bool P_TestMobjZ (AActor *mobj);
|
||||
bool P_TestMobjZ (AActor *mobj, bool quick=true);
|
||||
BOOL P_CheckPosition (AActor *thing, fixed_t x, fixed_t y);
|
||||
AActor *P_CheckOnmobj (AActor *thing);
|
||||
void P_FakeZMovement (AActor *mo);
|
||||
|
|
|
@ -1171,13 +1171,17 @@ BOOL PIT_CheckOnmobjZ (AActor *thing)
|
|||
{ // under thing
|
||||
return true;
|
||||
}
|
||||
else if (!tmflags && onmobj != NULL && thing->z + thing->height < onmobj->z + onmobj->height)
|
||||
{ // something higher is in the way
|
||||
return true;
|
||||
}
|
||||
fixed_t blockdist = thing->radius+tmthing->radius;
|
||||
if (abs(thing->x-tmx) >= blockdist || abs(thing->y-tmy) >= blockdist)
|
||||
{ // Didn't hit thing
|
||||
return true;
|
||||
}
|
||||
onmobj = thing;
|
||||
return false;
|
||||
return !tmflags;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1421,7 +1425,7 @@ AActor *P_CheckOnmobj (AActor *thing)
|
|||
|
||||
oldz = thing->z;
|
||||
P_FakeZMovement (thing);
|
||||
good = P_TestMobjZ (thing);
|
||||
good = P_TestMobjZ (thing, false);
|
||||
thing->z = oldz;
|
||||
|
||||
return good ? NULL : onmobj;
|
||||
|
@ -1433,19 +1437,21 @@ AActor *P_CheckOnmobj (AActor *thing)
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
bool P_TestMobjZ (AActor *actor)
|
||||
bool P_TestMobjZ (AActor *actor, bool quick)
|
||||
{
|
||||
static TArray<AActor *> mobjzbt;
|
||||
|
||||
int xl,xh,yl,yh,bx,by;
|
||||
fixed_t x, y;
|
||||
|
||||
onmobj = NULL;
|
||||
if (actor->flags & MF_NOCLIP)
|
||||
return true;
|
||||
|
||||
tmx = x = actor->x;
|
||||
tmy = y = actor->y;
|
||||
tmthing = actor;
|
||||
tmflags = quick;
|
||||
|
||||
tmbbox[BOXTOP] = y + actor->radius;
|
||||
tmbbox[BOXBOTTOM] = y - actor->radius;
|
||||
|
@ -1468,7 +1474,7 @@ bool P_TestMobjZ (AActor *actor)
|
|||
if (!P_BlockThingsIterator (bx, by, PIT_CheckOnmobjZ, mobjzbt))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return onmobj == NULL;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
Loading…
Reference in a new issue