MCPcopy Create free account
hub / github.com/EasyRPG/Player / Update

Method Update

src/game_map.cpp:1253–1315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1251}
1252
1253void 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 }

Callers 4

MakeWayUpdateFunction · 0.45
UpdateCommonEventsMethod · 0.45
UpdateMapEventsMethod · 0.45

Calls 10

GetParallaxParamsFunction · 0.85
IsParallelCommonEventMethod · 0.80
IsParallelMapEventMethod · 0.80
IsMessageMethod · 0.80
IsForegroundEventMethod · 0.80
UpdateFunction · 0.70
IsActiveMethod · 0.45
GetMapIdMethod · 0.45
UpdateTimersMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected