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

Method UpdateCommonEvents

src/game_map.cpp:1332–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330
1331
1332bool Game_Map::UpdateCommonEvents(MapUpdateAsyncContext& actx) {
1333 int resume_ce = actx.GetParallelCommonEvent();
1334
1335 for (Game_CommonEvent& ev : common_events) {
1336 bool resume_async = false;
1337 if (resume_ce != 0) {
1338 // If resuming, skip all until the event to resume from ..
1339 if (ev.GetIndex() != resume_ce) {
1340 continue;
1341 } else {
1342 resume_ce = 0;
1343 resume_async = true;
1344 }
1345 }
1346
1347 auto aop = ev.Update(resume_async);
1348 if (aop.IsActive()) {
1349 // Suspend due to this event ..
1350 actx = MapUpdateAsyncContext::FromCommonEvent(ev.GetIndex(), aop);
1351 return false;
1352 }
1353 }
1354
1355 actx = {};
1356 return true;
1357}
1358
1359bool Game_Map::UpdateMapEvents(MapUpdateAsyncContext& actx) {
1360 int resume_ev = actx.GetParallelMapEvent();

Callers

nothing calls this directly

Calls 4

GetIndexMethod · 0.45
UpdateMethod · 0.45
IsActiveMethod · 0.45

Tested by

no test coverage detected