| 1251 | } |
| 1252 | |
| 1253 | void Game_Map::Update(MapUpdateAsyncContext& actx, bool is_preupdate) { |
| 1254 | if (GetNeedRefresh()) { |
| 1255 | Refresh(); |
| 1256 | } |
| 1257 | |
| 1258 | if (!actx.IsActive()) { |
| 1259 | //If not resuming from async op ... |
| 1260 | UpdateProcessedFlags(is_preupdate); |
| 1261 | } |
| 1262 | |
| 1263 | if (!actx.IsActive() || actx.IsParallelCommonEvent()) { |
| 1264 | if (!UpdateCommonEvents(actx)) { |
| 1265 | // Suspend due to common event async op ... |
| 1266 | return; |
| 1267 | } |
| 1268 | } |
| 1269 | |
| 1270 | if (!actx.IsActive() || actx.IsParallelMapEvent()) { |
| 1271 | if (!UpdateMapEvents(actx)) { |
| 1272 | // Suspend due to map event async op ... |
| 1273 | return; |
| 1274 | } |
| 1275 | } |
| 1276 | |
| 1277 | if (is_preupdate) { |
| 1278 | return; |
| 1279 | } |
| 1280 | |
| 1281 | if (!actx.IsActive()) { |
| 1282 | //If not resuming from async op ... |
| 1283 | Main_Data::game_player->Update(); |
| 1284 | |
| 1285 | for (auto& vehicle: vehicles) { |
| 1286 | if (vehicle.GetMapId() == GetMapId()) { |
| 1287 | vehicle.Update(); |
| 1288 | } |
| 1289 | } |
| 1290 | } |
| 1291 | |
| 1292 | if (!actx.IsActive() || actx.IsMessage()) { |
| 1293 | if (!UpdateMessage(actx)) { |
| 1294 | // Suspend due to message async op ... |
| 1295 | return; |
| 1296 | } |
| 1297 | } |
| 1298 | |
| 1299 | if (!actx.IsActive()) { |
| 1300 | Main_Data::game_party->UpdateTimers(); |
| 1301 | Main_Data::game_screen->Update(); |
| 1302 | Main_Data::game_pictures->Update(false); |
| 1303 | } |
| 1304 | |
| 1305 | if (!actx.IsActive() || actx.IsForegroundEvent()) { |
| 1306 | if (!UpdateForegroundEvents(actx)) { |
| 1307 | // Suspend due to foreground event async op ... |
| 1308 | return; |
| 1309 | } |
| 1310 | } |
no test coverage detected