Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp
Show First 20 Lines • Show All 903 Lines • ▼ Show 20 Lines | while (timeLeft > zero) | ||||
fixed offsetLength = offset.Length(); | fixed offsetLength = offset.Length(); | ||||
if (offsetLength <= maxdist) | if (offsetLength <= maxdist) | ||||
{ | { | ||||
if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, target.X, target.Y, m_Clearance, m_PassClass)) | if (cmpPathfinder->CheckMovement(GetObstructionFilter(), pos.X, pos.Y, target.X, target.Y, m_Clearance, m_PassClass)) | ||||
{ | { | ||||
pos = target; | pos = target; | ||||
// Spend the rest of the time heading towards the next waypoint | // Spend the rest of the time heading towards the next waypoint | ||||
timeLeft = timeLeft - (offsetLength / maxSpeed); | timeLeft = (maxdist - offsetLength) / maxSpeed; | ||||
if (m_ShortPath.m_Waypoints.empty()) | if (m_ShortPath.m_Waypoints.empty()) | ||||
m_LongPath.m_Waypoints.pop_back(); | m_LongPath.m_Waypoints.pop_back(); | ||||
else | else | ||||
m_ShortPath.m_Waypoints.pop_back(); | m_ShortPath.m_Waypoints.pop_back(); | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 897 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator