mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- PlayerAngle: Adjust how settarget()
methods store angle for unsynchronised angle adjustments and adjust processhelpers()
method accordingly.
* Repairs angle issues raised in https://forum.zdoom.org/viewtopic.php?f=340&p=1185365.
This commit is contained in:
parent
a12f277846
commit
39fe9efaff
1 changed files with 15 additions and 15 deletions
|
@ -97,9 +97,9 @@ struct PlayerHorizon
|
|||
|
||||
struct PlayerAngle
|
||||
{
|
||||
binangle ang, oang;
|
||||
binangle ang, oang, target;
|
||||
lookangle look_ang, olook_ang, rotscrnang, orotscrnang, spin;
|
||||
double adjustment, target;
|
||||
double adjustment;
|
||||
|
||||
void backup()
|
||||
{
|
||||
|
@ -172,12 +172,12 @@ struct PlayerAngle
|
|||
{
|
||||
if (!SyncInput() && !backup)
|
||||
{
|
||||
target = (ang + getincanglebam(ang, buildang(value))).asbam();
|
||||
if (target == 0) target += 1;
|
||||
target = buildang(value & 2047);
|
||||
if (target.asbam() == 0) target = bamang(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ang = buildang(value);
|
||||
ang = buildang(value & 2047);
|
||||
if (backup) oang = ang;
|
||||
}
|
||||
}
|
||||
|
@ -186,12 +186,12 @@ struct PlayerAngle
|
|||
{
|
||||
if (!SyncInput() && !backup)
|
||||
{
|
||||
target = (ang + getincanglebam(ang, buildfang(value))).asbam();
|
||||
if (target == 0) target += 1;
|
||||
target = buildfang(fmod(value, 2048));
|
||||
if (target.asbam() == 0) target = bamang(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ang = buildfang(value);
|
||||
ang = buildfang(fmod(value, 2048));
|
||||
if (backup) oang = ang;
|
||||
}
|
||||
}
|
||||
|
@ -200,8 +200,8 @@ struct PlayerAngle
|
|||
{
|
||||
if (!SyncInput() && !backup)
|
||||
{
|
||||
target = (ang + getincanglebam(ang, value)).asbam();
|
||||
if (target == 0) target += 1;
|
||||
target = value;
|
||||
if (target.asbam() == 0) target = bamang(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -212,14 +212,14 @@ struct PlayerAngle
|
|||
|
||||
void processhelpers(double const scaleAdjust)
|
||||
{
|
||||
if (target)
|
||||
if (target.asbam())
|
||||
{
|
||||
ang += bamang(xs_CRoundToUInt(scaleAdjust * (target - ang.asbam())));
|
||||
ang += bamang(xs_CRoundToUInt(scaleAdjust * getincanglebam(ang, target).asbam()));
|
||||
|
||||
if (abs(ang.asbam() - target) < BAMUNIT)
|
||||
if (getincanglebam(ang, target).asbam() < BAMUNIT)
|
||||
{
|
||||
ang = bamang(target);
|
||||
target = 0;
|
||||
ang = target;
|
||||
target = bamang(0);
|
||||
}
|
||||
}
|
||||
else if (adjustment)
|
||||
|
|
Loading…
Reference in a new issue