mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-14 16:40:46 +00:00
- Exhumed: Remove PlayerInput::vel
in favour of just using actor's velocity.
This commit is contained in:
parent
73acffac2c
commit
67c7dd65f9
4 changed files with 5 additions and 9 deletions
|
@ -375,7 +375,7 @@ void GameInterface::Ticker()
|
||||||
// disable synchronised input if set by game.
|
// disable synchronised input if set by game.
|
||||||
resetForcedSyncInput();
|
resetForcedSyncInput();
|
||||||
|
|
||||||
auto& lPlayerVel = sPlayerInput[nLocalPlayer].vel;
|
auto& lPlayerVel = PlayerList[nLocalPlayer].pActor->vel.XY();
|
||||||
|
|
||||||
auto inputvect = DVector2(localInput.fvel, localInput.svel).Rotated(inita) * 0.375;
|
auto inputvect = DVector2(localInput.fvel, localInput.svel).Rotated(inita) * 0.375;
|
||||||
|
|
||||||
|
|
|
@ -68,9 +68,9 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
||||||
{
|
{
|
||||||
processMovement(&input, &localInput, hidInput, scaleAdjust);
|
processMovement(&input, &localInput, hidInput, scaleAdjust);
|
||||||
}
|
}
|
||||||
else
|
else if (pPlayer->pActor)
|
||||||
{
|
{
|
||||||
sPlayerInput[nLocalPlayer].vel.Zero();
|
pPlayer->pActor->vel.Zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SyncInput() && gamestate == GS_LEVEL && !nFreeze)
|
if (!SyncInput() && gamestate == GS_LEVEL && !nFreeze)
|
||||||
|
|
|
@ -32,7 +32,6 @@ enum {
|
||||||
// 32 bytes
|
// 32 bytes
|
||||||
struct PlayerInput
|
struct PlayerInput
|
||||||
{
|
{
|
||||||
DVector2 vel;
|
|
||||||
float nAngle;
|
float nAngle;
|
||||||
float pan;
|
float pan;
|
||||||
ESyncBits actions;
|
ESyncBits actions;
|
||||||
|
|
|
@ -855,7 +855,7 @@ bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectort
|
||||||
{
|
{
|
||||||
PlayerList[nPlayer].pPlayerPushSect = sect;
|
PlayerList[nPlayer].pPlayerPushSect = sect;
|
||||||
|
|
||||||
DVector2 vel = sPlayerInput[nPlayer].vel;
|
DVector2 vel = PlayerList[nPlayer].pActor->vel.XY();
|
||||||
auto nMyAngle = vel.Angle().Normalized360();
|
auto nMyAngle = vel.Angle().Normalized360();
|
||||||
|
|
||||||
setsectinterpolate(sect);
|
setsectinterpolate(sect);
|
||||||
|
@ -906,8 +906,6 @@ void AIPlayer::Tick(RunListEvent* ev)
|
||||||
int nAction = PlayerList[nPlayer].nAction;
|
int nAction = PlayerList[nPlayer].nAction;
|
||||||
int nActionB = PlayerList[nPlayer].nAction;
|
int nActionB = PlayerList[nPlayer].nAction;
|
||||||
|
|
||||||
pPlayerActor->vel.XY() = sPlayerInput[nPlayer].vel;
|
|
||||||
|
|
||||||
if (PlayerList[nPlayer].nCurrentItem > -1)
|
if (PlayerList[nPlayer].nCurrentItem > -1)
|
||||||
{
|
{
|
||||||
UseItem(nPlayer, PlayerList[nPlayer].nCurrentItem);
|
UseItem(nPlayer, PlayerList[nPlayer].nCurrentItem);
|
||||||
|
@ -1006,7 +1004,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
||||||
|
|
||||||
auto playerPos = pPlayerActor->spr.pos.XY();
|
auto playerPos = pPlayerActor->spr.pos.XY();
|
||||||
|
|
||||||
DVector2 vect = sPlayerInput[nPlayer].vel;
|
DVector2 vect = pPlayerActor->vel.XY();
|
||||||
double zz = pPlayerActor->vel.Z;
|
double zz = pPlayerActor->vel.Z;
|
||||||
|
|
||||||
if (pPlayerActor->vel.Z > 32)
|
if (pPlayerActor->vel.Z > 32)
|
||||||
|
@ -1074,7 +1072,6 @@ void AIPlayer::Tick(RunListEvent* ev)
|
||||||
pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle);
|
pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle);
|
||||||
pPlayerActor->backupang();
|
pPlayerActor->backupang();
|
||||||
|
|
||||||
sPlayerInput[nPlayer].vel.Zero();
|
|
||||||
pPlayerActor->vel.Zero();
|
pPlayerActor->vel.Zero();
|
||||||
|
|
||||||
if (nFreeze < 1)
|
if (nFreeze < 1)
|
||||||
|
|
Loading…
Reference in a new issue