mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-21 11:31:41 +00:00
Scriptified the view squatting.
This commit is contained in:
parent
ab20b75c14
commit
ae28eeae94
2 changed files with 21 additions and 7 deletions
|
@ -2811,15 +2811,18 @@ static void PlayerLandedMakeGruntSound(AActor* self, AActor *onmobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void PlayerSquatView(AActor *self, AActor *onmobj)
|
||||||
|
{
|
||||||
|
IFVIRTUALPTR(self, AActor, PlayerSquatView)
|
||||||
|
{
|
||||||
|
VMValue params[2] = { self, onmobj };
|
||||||
|
VMCall(func, params, 2, nullptr, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
|
static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
|
||||||
{
|
{
|
||||||
if (!mo->player)
|
PlayerSquatView(mo, onmobj);
|
||||||
return;
|
|
||||||
|
|
||||||
if (mo->player->mo == mo)
|
|
||||||
{
|
|
||||||
mo->player->deltaviewheight = mo->Vel.Z / 8.;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mo->player->cheats & CF_PREDICTING)
|
if (mo->player->cheats & CF_PREDICTING)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1439,6 +1439,17 @@ class Actor : Thinker native
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void PlayerSquatView(Actor onmobj)
|
||||||
|
{
|
||||||
|
if (!self.player)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (self.player.mo == self)
|
||||||
|
{
|
||||||
|
self.player.deltaviewheight = self.Vel.Z / 8.;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// PROC A_CheckSkullDone
|
// PROC A_CheckSkullDone
|
||||||
|
|
Loading…
Reference in a new issue