mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +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)
|
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.
|
- Added disintegration damage to SectorDamage.
|
||||||
- Bumped savegame version, min. savegame version, netgame version and
|
- Bumped savegame version, min. savegame version, netgame version and
|
||||||
demo version because the inventory and damage changes are incompatible
|
demo version because the inventory and damage changes are incompatible
|
||||||
|
|
|
@ -277,7 +277,7 @@ extern bool DoRipping;
|
||||||
extern AActor *LastRipped;
|
extern AActor *LastRipped;
|
||||||
|
|
||||||
BOOL P_TestMobjLocation (AActor *mobj);
|
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);
|
BOOL P_CheckPosition (AActor *thing, fixed_t x, fixed_t y);
|
||||||
AActor *P_CheckOnmobj (AActor *thing);
|
AActor *P_CheckOnmobj (AActor *thing);
|
||||||
void P_FakeZMovement (AActor *mo);
|
void P_FakeZMovement (AActor *mo);
|
||||||
|
|
|
@ -1171,13 +1171,17 @@ BOOL PIT_CheckOnmobjZ (AActor *thing)
|
||||||
{ // under thing
|
{ // under thing
|
||||||
return true;
|
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;
|
fixed_t blockdist = thing->radius+tmthing->radius;
|
||||||
if (abs(thing->x-tmx) >= blockdist || abs(thing->y-tmy) >= blockdist)
|
if (abs(thing->x-tmx) >= blockdist || abs(thing->y-tmy) >= blockdist)
|
||||||
{ // Didn't hit thing
|
{ // Didn't hit thing
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
onmobj = thing;
|
onmobj = thing;
|
||||||
return false;
|
return !tmflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1421,7 +1425,7 @@ AActor *P_CheckOnmobj (AActor *thing)
|
||||||
|
|
||||||
oldz = thing->z;
|
oldz = thing->z;
|
||||||
P_FakeZMovement (thing);
|
P_FakeZMovement (thing);
|
||||||
good = P_TestMobjZ (thing);
|
good = P_TestMobjZ (thing, false);
|
||||||
thing->z = oldz;
|
thing->z = oldz;
|
||||||
|
|
||||||
return good ? NULL : onmobj;
|
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;
|
static TArray<AActor *> mobjzbt;
|
||||||
|
|
||||||
int xl,xh,yl,yh,bx,by;
|
int xl,xh,yl,yh,bx,by;
|
||||||
fixed_t x, y;
|
fixed_t x, y;
|
||||||
|
|
||||||
|
onmobj = NULL;
|
||||||
if (actor->flags & MF_NOCLIP)
|
if (actor->flags & MF_NOCLIP)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
tmx = x = actor->x;
|
tmx = x = actor->x;
|
||||||
tmy = y = actor->y;
|
tmy = y = actor->y;
|
||||||
tmthing = actor;
|
tmthing = actor;
|
||||||
|
tmflags = quick;
|
||||||
|
|
||||||
tmbbox[BOXTOP] = y + actor->radius;
|
tmbbox[BOXTOP] = y + actor->radius;
|
||||||
tmbbox[BOXBOTTOM] = 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))
|
if (!P_BlockThingsIterator (bx, by, PIT_CheckOnmobjZ, mobjzbt))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return onmobj == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
Loading…
Reference in a new issue