mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-14 10:15:26 +00:00
#788 Eliminate delay in path finding (and therefore moving)
This was SVN commit r9665.
This commit is contained in:
@@ -229,6 +229,10 @@ bool CSimulation2Impl::Update(int turnLength, const std::vector<SimulationComman
|
||||
if (!cmpCommandQueue.null())
|
||||
cmpCommandQueue->FlushTurn(commands);
|
||||
|
||||
// Process newly generated move commands so the UI feels snappy
|
||||
if (!cmpPathfinder.null())
|
||||
cmpPathfinder->ProcessSameTurnMoves();
|
||||
|
||||
// Send all the update phases
|
||||
{
|
||||
CMessageUpdate msgUpdate(turnLengthFixed);
|
||||
@@ -238,6 +242,11 @@ bool CSimulation2Impl::Update(int turnLength, const std::vector<SimulationComman
|
||||
CMessageUpdate_MotionFormation msgUpdate(turnLengthFixed);
|
||||
m_ComponentManager.BroadcastMessage(msgUpdate);
|
||||
}
|
||||
|
||||
// Process move commands for formations (group proxy)
|
||||
if (!cmpPathfinder.null())
|
||||
cmpPathfinder->ProcessSameTurnMoves();
|
||||
|
||||
{
|
||||
CMessageUpdate_MotionUnit msgUpdate(turnLengthFixed);
|
||||
m_ComponentManager.BroadcastMessage(msgUpdate);
|
||||
@@ -247,6 +256,11 @@ bool CSimulation2Impl::Update(int turnLength, const std::vector<SimulationComman
|
||||
m_ComponentManager.BroadcastMessage(msgUpdate);
|
||||
}
|
||||
|
||||
// Process moves resulting from group proxy movement (unit needs to catch up or realign) and any others
|
||||
if (!cmpPathfinder.null())
|
||||
cmpPathfinder->ProcessSameTurnMoves();
|
||||
|
||||
|
||||
// Clean up any entities destroyed during the simulation update
|
||||
m_ComponentManager.FlushDestroyedComponents();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user