mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +00:00
- wrapped access to the current 'move' values read from CON.
This commit is contained in:
parent
c76c511da2
commit
94b676bd7c
5 changed files with 24 additions and 12 deletions
|
@ -3256,10 +3256,10 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
||||||
|
|
||||||
aang = actor->spr.Angles.Yaw;
|
aang = actor->spr.Angles.Yaw;
|
||||||
|
|
||||||
actor->vel.X += (moveptr[0] / 16 - actor->vel.X) / 5;
|
actor->vel.X += (actor->GetMoveX() - actor->vel.X) / 5;
|
||||||
if (actor->vel.Z < (648 / 256.))
|
if (actor->vel.Z < (648 / 256.))
|
||||||
{
|
{
|
||||||
actor->vel.Z += (moveptr[1] / 16 - actor->vel.Z) / 5;
|
actor->vel.Z += (actor->GetMoveZ() - actor->vel.Z) / 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRRRA() && (ang & windang))
|
if (isRRRA() && (ang & windang))
|
||||||
|
|
|
@ -1195,10 +1195,8 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto moveptr = &ScriptCode[actor->temp_data[1]];
|
if (a & geth) actor->vel.X += (actor->GetMoveX() - actor->vel.X) * 0.5;
|
||||||
|
if (a & getv) actor->vel.Z += (actor->GetMoveZ() - actor->vel.Z) * 0.5;
|
||||||
if (a & geth) actor->vel.X += (moveptr[0] / 16. - actor->vel.X) * 0.5;
|
|
||||||
if (a & getv) actor->vel.Z += (moveptr[1] / 16. - actor->vel.Z) * 0.5;
|
|
||||||
|
|
||||||
if (a & dodgebullet)
|
if (a & dodgebullet)
|
||||||
dodge(actor);
|
dodge(actor);
|
||||||
|
@ -1295,7 +1293,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
||||||
}
|
}
|
||||||
else if (!(actor->flags2 & SFLAG2_FLOATING))
|
else if (!(actor->flags2 & SFLAG2_FLOATING))
|
||||||
{
|
{
|
||||||
if (!*(moveptr + 1))
|
if (actor->GetMoveZ() == 0)
|
||||||
{
|
{
|
||||||
if (actor->opos.Z != actor->spr.pos.Z || (ud.multimode < 2 && ud.player_skill < 2))
|
if (actor->opos.Z != actor->spr.pos.Z || (ud.multimode < 2 && ud.player_skill < 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1346,10 +1346,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto moveptr = &ScriptCode[actor->temp_data[1]];
|
if (a & geth) actor->vel.X += (actor->GetMoveX() - actor->vel.X) * 0.5;
|
||||||
|
if (a & getv) actor->vel.Z += (actor->GetMoveZ() - actor->vel.Z) * 0.5;
|
||||||
if (a & geth) actor->vel.X += (moveptr[0] / 16. - actor->vel.X) * 0.5;
|
|
||||||
if (a & getv) actor->vel.Z += (moveptr[1] / 16. - actor->vel.Z) * 0.5;
|
|
||||||
|
|
||||||
if (a & dodgebullet)
|
if (a & dodgebullet)
|
||||||
dodge(actor);
|
dodge(actor);
|
||||||
|
@ -1422,7 +1420,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
||||||
}
|
}
|
||||||
else if (!(actor->flags2 & SFLAG2_FLOATING))
|
else if (!(actor->flags2 & SFLAG2_FLOATING))
|
||||||
{
|
{
|
||||||
if (!*(moveptr + 1))
|
if (actor->GetMoveZ() == 0)
|
||||||
{
|
{
|
||||||
if (actor->opos.Z != actor->spr.pos.Z || (ud.multimode < 2 && ud.player_skill < 2))
|
if (actor->opos.Z != actor->spr.pos.Z || (ud.multimode < 2 && ud.player_skill < 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -314,6 +314,18 @@ inline void processinputvel(int snum)
|
||||||
p->sync.svel = (float)velvect.Y;
|
p->sync.svel = (float)velvect.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline double DDukeActor::GetMoveX() const
|
||||||
|
{
|
||||||
|
auto moveptr = &ScriptCode[temp_data[1]];
|
||||||
|
return moveptr[0] / 16.;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline double DDukeActor::GetMoveZ() const
|
||||||
|
{
|
||||||
|
auto moveptr = &ScriptCode[temp_data[1]];
|
||||||
|
return moveptr[1] / 16.;
|
||||||
|
}
|
||||||
|
|
||||||
inline void setPlayerActorViewZOffset(DDukeActor* const pact)
|
inline void setPlayerActorViewZOffset(DDukeActor* const pact)
|
||||||
{
|
{
|
||||||
if (!PlayClock)
|
if (!PlayClock)
|
||||||
|
|
|
@ -135,6 +135,10 @@ public:
|
||||||
clipdist = spr.scale.X * tex->GetDisplayWidth() * 0.125;
|
clipdist = spr.scale.X * tex->GetDisplayWidth() * 0.125;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrappers around CON data.
|
||||||
|
|
||||||
|
double GetMoveX() const;
|
||||||
|
double GetMoveZ() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// subclassed to add a game specific actor() method
|
// subclassed to add a game specific actor() method
|
||||||
|
|
Loading…
Reference in a new issue