mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 00:21:43 +00:00
Make CheckActor*Texture also consider swimmable 3D floors
An actor standing within a swimmable floor whose ceiling texture is X and on a solid floor whose texture is Y will now be reported as standing on both.
This commit is contained in:
parent
81b3f48792
commit
1ab9d15481
1 changed files with 29 additions and 9 deletions
|
@ -4140,16 +4140,26 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
|
||||||
|
|
||||||
if (floor)
|
if (floor)
|
||||||
{
|
{
|
||||||
|
fixed_t z = actor->z;
|
||||||
// Looking through planes from top to bottom
|
// Looking through planes from top to bottom
|
||||||
for (i = 0; i < numff; ++i)
|
for (i = 0; i < numff; ++i)
|
||||||
{
|
{
|
||||||
F3DFloor *ff = sec->e->XFloor.ffloors[i];
|
F3DFloor *ff = sec->e->XFloor.ffloors[i];
|
||||||
|
if (!(ff->flags & FF_EXISTS))
|
||||||
|
continue;
|
||||||
|
|
||||||
if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) &&
|
if (ff->flags & FF_SOLID &&
|
||||||
actor->Z() >= ff->top.plane->ZatPoint(actor))
|
secpic.isNull() &&
|
||||||
{ // This floor is beneath our feet.
|
z >= ff->top.plane->ZatPoint(actor->X(), actor->Y()))
|
||||||
|
{ // This is the highest solid floor beneath our feet
|
||||||
secpic = *ff->top.texture;
|
secpic = *ff->top.texture;
|
||||||
break;
|
}
|
||||||
|
else if (ff->flags & FF_SWIMMABLE &&
|
||||||
|
tex == TexMan[*ff->top.texture] &&
|
||||||
|
z <= ff->top.plane->ZatPoint(actor->x, actor->y) &&
|
||||||
|
z >= ff->bottom.plane->ZatPoint(actor->x, actor->y))
|
||||||
|
{ // Having your feet within a liquid count as being "on" it
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == numff)
|
if (i == numff)
|
||||||
|
@ -4165,11 +4175,21 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
|
||||||
{
|
{
|
||||||
F3DFloor *ff = sec->e->XFloor.ffloors[i];
|
F3DFloor *ff = sec->e->XFloor.ffloors[i];
|
||||||
|
|
||||||
if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) &&
|
if (!(ff->flags & FF_EXISTS))
|
||||||
z <= ff->bottom.plane->ZatPoint(actor))
|
continue;
|
||||||
{ // This floor is above our eyes.
|
|
||||||
secpic = *ff->bottom.texture;
|
if (ff->flags & FF_SOLID &&
|
||||||
break;
|
secpic.isNull() &&
|
||||||
|
z <= ff->bottom.plane->ZatPoint(actor->X(), actor->Y()))
|
||||||
|
{ // This is the lowest solid ceiling above our eyes
|
||||||
|
secpic = *ff->top.texture;
|
||||||
|
}
|
||||||
|
else if (ff->flags & FF_SWIMMABLE &&
|
||||||
|
tex == TexMan[*ff->bottom.texture] &&
|
||||||
|
z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) &&
|
||||||
|
z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y()))
|
||||||
|
{ // Having your eyes within a liquid count as being "under" it
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
|
|
Loading…
Reference in a new issue