mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 14:41:40 +00:00
- Couple additional fixes:
- The wiki said the minimum distance to teleport defaults to 0, actor.txt on the other hand said otherwise. I was wondering why it was still broken somewhat... - Prevent stickiness from happening, a.k.a. getting stuck in ceiling or floor and letting the engine unstick the actor. This caused velocity loss.
This commit is contained in:
parent
e5a41a1358
commit
c168761eda
2 changed files with 15 additions and 8 deletions
|
@ -4199,16 +4199,23 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport)
|
|||
fixed_t prevX = self->x;
|
||||
fixed_t prevY = self->y;
|
||||
fixed_t prevZ = self->z;
|
||||
fixed_t aboveFloor = spot->z - spot->floorz;
|
||||
fixed_t finalz = spot->floorz + aboveFloor;
|
||||
|
||||
if (spot->z + self->height > spot->ceilingz)
|
||||
finalz = spot->ceilingz - self->height;
|
||||
else if (spot->z < spot->floorz)
|
||||
finalz = spot->floorz;
|
||||
|
||||
|
||||
//Take precedence and cooperate with telefragging first.
|
||||
bool teleResult = P_TeleportMove(self, spot->x, spot->y, spot->z, Flags & TF_TELEFRAG);
|
||||
|
||||
if ((!(teleResult)) && (Flags & TF_FORCED))
|
||||
{
|
||||
//If for some reason the original move didn't work, regardless of telefrag, force it to move.
|
||||
self->SetOrigin(spot->x, spot->y, spot->z);
|
||||
teleResult = true;
|
||||
bool teleResult = P_TeleportMove(self, spot->x, spot->y, finalz, Flags & TF_TELEFRAG);
|
||||
|
||||
if (Flags & TF_FORCED)
|
||||
{
|
||||
//If for some reason the original move didn't work, regardless of telefrag, force it to move.
|
||||
self->SetOrigin(spot->x, spot->y, finalz);
|
||||
teleResult = true;
|
||||
}
|
||||
|
||||
if (teleResult)
|
||||
|
|
|
@ -244,7 +244,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_CheckCeiling(state label);
|
||||
action native A_PlayerSkinCheck(state label);
|
||||
action native A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, float missileheight);
|
||||
action native A_Teleport(state teleportstate = "", class<SpecialSpot> targettype = "BossSpot", class<Actor> fogtype = "TeleportFog", int flags = 0, float mindist = 128, float maxdist = 0);
|
||||
action native A_Teleport(state teleportstate = "", class<SpecialSpot> targettype = "BossSpot", class<Actor> fogtype = "TeleportFog", int flags = 0, float mindist = 0, float maxdist = 0);
|
||||
action native A_Warp(int ptr_destination, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0, int flags = 0, state success_state = "");
|
||||
action native A_ThrowGrenade(class<Actor> itemtype, float zheight = 0, float xyvel = 0, float zvel = 0, bool useammo = true);
|
||||
action native A_Weave(int xspeed, int yspeed, float xdist, float ydist);
|
||||
|
|
Loading…
Reference in a new issue