Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 93cdbf5

Browse files
committed
Fixed controller running updateai before update happened, which could cause radius problems
AI will now only start running after the first actual update run
1 parent f342140 commit 93cdbf5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Entities/Actor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,8 @@ void Actor::VerifyMOIDs()
13711371

13721372
void Actor::Update()
13731373
{
1374-
// Update the controller!
1374+
//TODO This should be after MOSRotating::Update call. It's here because this lets Attachable scripts affect their parent's control states, but this is a bad, hacky solution.
1375+
//See https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/commit/ea20b6d790cd4cbb41eb923057b3db9982f6545d
13751376
m_Controller.Update();
13761377

13771378
/////////////////////////////////

System/Controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ namespace RTE {
162162
}
163163

164164
// Update the AI state of the Actor we're controlling and to use any scripted AI defined for this Actor.
165-
if (m_ControlledActor && !m_ControlledActor->UpdateAIScripted()) {
165+
if (m_ControlledActor && m_ControlledActor->ObjectScriptsInitialized() && !m_ControlledActor->UpdateAIScripted()) {
166166
// If we can't, fall back on the legacy C++ implementation
167167
m_ControlledActor->UpdateAI();
168168
}

0 commit comments

Comments
 (0)