| 269 | } |
| 270 | |
| 271 | uint32_t doCommandForReal(GameCommand command, CompanyId company, const registers& regs) |
| 272 | { |
| 273 | _updatingCompanyId = company; |
| 274 | |
| 275 | uint16_t flags = regs.bx; |
| 276 | uint32_t esi = static_cast<uint32_t>(command); |
| 277 | |
| 278 | if (commandRequiresUnpausingGame(command, flags) && _updatingCompanyId == CompanyManager::getControllingId()) |
| 279 | { |
| 280 | if ((SceneManager::getPauseFlags() & PauseFlags::player) != PauseFlags::none) |
| 281 | { |
| 282 | SceneManager::unsetPauseFlag(PauseFlags::player); |
| 283 | Ui::Windows::PlayerInfoPanel::invalidateFrame(); |
| 284 | } |
| 285 | |
| 286 | if (SceneManager::getGameSpeed() != GameSpeed::Normal) |
| 287 | { |
| 288 | // calling the command setGameSpeed will cause infinite recursion here, so just call the real function |
| 289 | SceneManager::setGameSpeed(GameSpeed::Normal); |
| 290 | } |
| 291 | |
| 292 | if (SceneManager::isPaused()) |
| 293 | { |
| 294 | _gGameCommandErrorText = StringIds::empty; |
| 295 | return GameCommands::kFailure; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | if (_updatingCompanyId == CompanyManager::getControllingId() && SceneManager::isNetworked()) |
| 300 | { |
| 301 | // assert(false); |
| 302 | // registers fnRegs = regs; |
| 303 | // call(0x0046E34A, fnRegs); // some network stuff. Untested |
| 304 | } |
| 305 | |
| 306 | return loc_4313C6(esi, regs); |
| 307 | } |
| 308 | |
| 309 | static void callGameCommandFunction(uint32_t command, registers& regs) |
| 310 | { |
no test coverage detected