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

Method UpdateMapEvents

src/game_map.cpp:1359–1384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357}
1358
1359bool Game_Map::UpdateMapEvents(MapUpdateAsyncContext& actx) {
1360 int resume_ev = actx.GetParallelMapEvent();
1361
1362 for (Game_Event& ev : events) {
1363 bool resume_async = false;
1364 if (resume_ev != 0) {
1365 // If resuming, skip all until the event to resume from ..
1366 if (ev.GetId() != resume_ev) {
1367 continue;
1368 } else {
1369 resume_ev = 0;
1370 resume_async = true;
1371 }
1372 }
1373
1374 auto aop = ev.Update(resume_async);
1375 if (aop.IsActive()) {
1376 // Suspend due to this event ..
1377 actx = MapUpdateAsyncContext::FromMapEvent(ev.GetId(), aop);
1378 return false;
1379 }
1380 }
1381
1382 actx = {};
1383 return true;
1384}
1385
1386bool Game_Map::UpdateMessage(MapUpdateAsyncContext& actx) {
1387 // Message system does not support suspend and resume internally. So if the last frame the message

Callers

nothing calls this directly

Calls 4

GetParallelMapEventMethod · 0.80
GetIdMethod · 0.45
UpdateMethod · 0.45
IsActiveMethod · 0.45

Tested by

no test coverage detected