mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 05:20:43 +00:00
- initialize SOP angles to 0.
The memset to -1 turns them into NANs.
This commit is contained in:
parent
176afdc00a
commit
3bb0ee69a1
2 changed files with 10 additions and 5 deletions
|
@ -380,6 +380,10 @@ void SectorSetup(void)
|
||||||
SectorObject[ndx].op_main_sector = nullptr;
|
SectorObject[ndx].op_main_sector = nullptr;
|
||||||
SectorObject[ndx].morph_wall_point = nullptr;
|
SectorObject[ndx].morph_wall_point = nullptr;
|
||||||
SectorObject[ndx].pmid.X = MAXSO;
|
SectorObject[ndx].pmid.X = MAXSO;
|
||||||
|
SectorObject[ndx].ang = SectorObject[ndx].ang_moving = SectorObject[ndx].ang_tgt =
|
||||||
|
SectorObject[ndx].ang_orig = SectorObject[ndx].last_ang = SectorObject[ndx].old_ang =
|
||||||
|
SectorObject[ndx].spin_speed = SectorObject[ndx].save_spin_speed = SectorObject[ndx].spin_ang = nullAngle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(SineWaveFloor, 0, sizeof(SineWaveFloor));
|
memset(SineWaveFloor, 0, sizeof(SineWaveFloor));
|
||||||
|
|
|
@ -1754,7 +1754,8 @@ PlayerPart:
|
||||||
|
|
||||||
void RefreshPoints(SECTOR_OBJECT* sop, const DVector2& move, bool dynamic)
|
void RefreshPoints(SECTOR_OBJECT* sop, const DVector2& move, bool dynamic)
|
||||||
{
|
{
|
||||||
short wallcount = 0, delta_ang_from_orig;
|
short wallcount = 0;
|
||||||
|
DAngle delta_ang_from_orig;
|
||||||
|
|
||||||
// do scaling
|
// do scaling
|
||||||
if (dynamic && sop->PreMoveAnimator)
|
if (dynamic && sop->PreMoveAnimator)
|
||||||
|
@ -1811,23 +1812,23 @@ void RefreshPoints(SECTOR_OBJECT* sop, const DVector2& move, bool dynamic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sop->int_i_spin_speed())
|
if (sop->spin_speed != nullAngle)
|
||||||
{
|
{
|
||||||
// same as below - ignore the objects angle
|
// same as below - ignore the objects angle
|
||||||
// last_ang is the last true angle before SO started spinning
|
// last_ang is the last true angle before SO started spinning
|
||||||
delta_ang_from_orig = NORM_ANGLE(sop->int_i_last_ang() + sop->int_i_spin_ang() - sop->int_i_ang_orig());
|
delta_ang_from_orig = (sop->last_ang + sop->spin_ang - sop->ang_orig).Normalized360();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// angle traveling + the new spin angle all offset from the original
|
// angle traveling + the new spin angle all offset from the original
|
||||||
// angle
|
// angle
|
||||||
delta_ang_from_orig = NORM_ANGLE(sop->int_i_ang() + sop->int_i_spin_ang() - sop->int_i_ang_orig());
|
delta_ang_from_orig = (sop->ang + sop->spin_ang - sop->ang_orig).Normalized360();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note that this delta angle is from the original angle
|
// Note that this delta angle is from the original angle
|
||||||
// nx,ny are 0 so the points are not moved, just rotated
|
// nx,ny are 0 so the points are not moved, just rotated
|
||||||
|
|
||||||
MovePoints(sop, DAngle::fromBuild(delta_ang_from_orig), move);
|
MovePoints(sop, delta_ang_from_orig, move);
|
||||||
|
|
||||||
// do morphing - angle independent
|
// do morphing - angle independent
|
||||||
if (dynamic && sop->PostMoveAnimator)
|
if (dynamic && sop->PostMoveAnimator)
|
||||||
|
|
Loading…
Reference in a new issue