Minor CScriptActorRotate fixes

Former-commit-id: f24314aa02
This commit is contained in:
Phillip Stephens 2022-12-23 22:22:44 -08:00
parent a5bab3c588
commit 06c2dec94d
1 changed files with 35 additions and 29 deletions

View File

@ -68,7 +68,7 @@ void CScriptActorRotate::RebuildSpiderBallWaypoints(CStateManager& mgr) {
CScriptSpiderBallWaypoint* wp = static_cast< CScriptSpiderBallWaypoint* >(mgr.ObjectById(*it)); CScriptSpiderBallWaypoint* wp = static_cast< CScriptSpiderBallWaypoint* >(mgr.ObjectById(*it));
if (wp) { if (wp) {
wp->BuildWaypointListAndBounds(mgr); wp->BuildWaypointListAndBounds(mgr);
wp->SetTransformDirty(false); wp->SetTransformDirty(true);
} }
} }
@ -76,7 +76,10 @@ void CScriptActorRotate::RebuildSpiderBallWaypoints(CStateManager& mgr) {
} }
void CScriptActorRotate::Think(float dt, CStateManager& mgr) { void CScriptActorRotate::Think(float dt, CStateManager& mgr) {
if (x58_24_updateRotation && GetActive()) { if (!x58_24_updateRotation || !GetActive()) {
return;
}
x44_currentTime += dt; x44_currentTime += dt;
if (x44_currentTime >= x40_maxTime) { if (x44_currentTime >= x40_maxTime) {
x58_24_updateRotation = false; x58_24_updateRotation = false;
@ -112,7 +115,6 @@ void CScriptActorRotate::Think(float dt, CStateManager& mgr) {
} }
} }
} }
}
void CScriptActorRotate::UpdateActors(bool next, CStateManager& mgr) { void CScriptActorRotate::UpdateActors(bool next, CStateManager& mgr) {
if (x58_24_updateRotation) { if (x58_24_updateRotation) {
@ -144,7 +146,11 @@ void CScriptActorRotate::UpdateActors(bool next, CStateManager& mgr) {
if (!x48_actors.empty()) { if (!x48_actors.empty()) {
x58_24_updateRotation = true; x58_24_updateRotation = true;
x44_currentTime = (next ? x40_maxTime : 0.f); if (next) {
x44_currentTime = x40_maxTime;
} else {
x44_currentTime = 0.f;
}
} }
} }