0x00431315
| 237 | |
| 238 | // 0x00431315 |
| 239 | uint32_t doCommand(GameCommand command, const registers& regs) |
| 240 | { |
| 241 | uint16_t flags = regs.bx; |
| 242 | uint32_t esi = static_cast<uint32_t>(command); |
| 243 | |
| 244 | _gameCommandFlags = regs.bx; |
| 245 | if (_gameCommandNestLevel != 0) |
| 246 | { |
| 247 | return loc_4313C6(esi, regs); |
| 248 | } |
| 249 | |
| 250 | if ((flags & Flags::apply) == 0) |
| 251 | { |
| 252 | return loc_4313C6(esi, regs); |
| 253 | } |
| 254 | |
| 255 | auto isGhost = (flags & Flags::ghost) != 0; |
| 256 | if (!isGhost && Network::isConnected()) |
| 257 | { |
| 258 | // For network games, we need to delay the command apply processing |
| 259 | // Just return the result without applying for now |
| 260 | registers copyRegs = regs; |
| 261 | copyRegs.esi = static_cast<int32_t>(command); |
| 262 | Network::queueGameCommand(_updatingCompanyId, copyRegs); |
| 263 | |
| 264 | copyRegs.bx &= ~Flags::apply; |
| 265 | return loc_4313C6(esi, copyRegs); |
| 266 | } |
| 267 | |
| 268 | return doCommandForReal(command, _updatingCompanyId, regs); |
| 269 | } |
| 270 | |
| 271 | uint32_t doCommandForReal(GameCommand command, CompanyId company, const registers& regs) |
| 272 | { |
no test coverage detected