void SpaceStation::StaticUpdate(const float timeStep) { bool update = false; // if there's no BB and there are ships here, make one if (!m_bbCreated && GetFreeDockingPort() != 0) { CreateBB(); update = true; } // if there is and it hasn't had an update for a while, update it else if (Pi::game->GetTime() > m_lastUpdatedShipyard) { LuaEvent::Queue("onUpdateBB", this); update = true; } if (update) { UpdateShipyard(); // update again in an hour or two m_lastUpdatedShipyard = Pi::game->GetTime() + 3600.0 + 3600.0*Pi::rng.Double(); } DoLawAndOrder(timeStep); DockingUpdate(timeStep); m_navLights->Update(timeStep); }
void SpaceStation::TimeStepUpdate(const float timeStep) { if (Pi::GetGameTime() > m_lastUpdatedShipyard) { if (m_bbCreated) Pi::luaOnUpdateBB.Queue(this); UpdateShipyard(); // update again in an hour or two m_lastUpdatedShipyard = Pi::GetGameTime() + 3600.0 + 3600.0*Pi::rng.Double(); } DoDockingAnimation(timeStep); DoLawAndOrder(); }
void SpaceStation::StaticUpdate(const float timeStep) { DoLawAndOrder(timeStep); DockingUpdate(timeStep); m_navLights->Update(timeStep); }