diff --git a/engines/mm/mm1/maps/map12.cpp b/engines/mm/mm1/maps/map12.cpp index 7e89bd2df32..58b3db01704 100644 --- a/engines/mm/mm1/maps/map12.cpp +++ b/engines/mm/mm1/maps/map12.cpp @@ -195,7 +195,7 @@ void Map12::setPolyhedron(int polyIndex) { msg, []() { static_cast(g_maps->_currentMap)->spinPolyhedron(0); - updateGame(); + g_maps->_currentMap->updateGame(); } )); @@ -206,9 +206,9 @@ void Map12::setPolyhedron(int polyIndex) { if (ks.keycode >= Common::KEYCODE_0 && ks.keycode <= Common::KEYCODE_9) { g_events->close(); - static_cast(g_maps->_currentMap)->spinPolyhedron( - ks.ascii | 0x80); - none160(); + Map12 &map = *static_cast(g_maps->_currentMap); + map.spinPolyhedron(ks.ascii | 0x80); + map.none160(); } } )); diff --git a/engines/mm/mm1/maps/map13.cpp b/engines/mm/mm1/maps/map13.cpp index 8b31510a462..7f5b1143611 100644 --- a/engines/mm/mm1/maps/map13.cpp +++ b/engines/mm/mm1/maps/map13.cpp @@ -148,7 +148,7 @@ void Map13::special10() { 0, 1, STRING["maps.map13.snake_pit"], []() { static_cast(g_maps->_currentMap)->encounter( - getRandomNumber(3) + 10, 14, 1); + g_events->getRandomNumber(3) + 10, 14, 1); } ); msg._delaySeconds = 2; diff --git a/engines/mm/mm1/maps/map14.cpp b/engines/mm/mm1/maps/map14.cpp index 96bb57d3122..6748ad98735 100644 --- a/engines/mm/mm1/maps/map14.cpp +++ b/engines/mm/mm1/maps/map14.cpp @@ -90,7 +90,7 @@ void Map14::special00() { // Note: The original seems to be backwards if (ks.keycode == Common::KEYCODE_n && - getRandomNumber(3) == 3) { + g_events->getRandomNumber(3) == 3) { g_maps->_mapPos = Common::Point(15, 10); } else { map[VAL1]++; diff --git a/engines/mm/mm1/maps/map15.cpp b/engines/mm/mm1/maps/map15.cpp index 9ca15fa60df..de5393f670f 100644 --- a/engines/mm/mm1/maps/map15.cpp +++ b/engines/mm/mm1/maps/map15.cpp @@ -181,7 +181,7 @@ void Map15::special06() { STRING["maps.map15.percella2"], []() { g_maps->_mapPos = Common::Point(14, 2); - updateGame(); + g_maps->_currentMap->updateGame(); } ); msg._delaySeconds = 5; diff --git a/engines/mm/mm1/maps/map20.cpp b/engines/mm/mm1/maps/map20.cpp index ffec1a6adb8..a52f233e686 100644 --- a/engines/mm/mm1/maps/map20.cpp +++ b/engines/mm/mm1/maps/map20.cpp @@ -142,7 +142,7 @@ void Map20::special03() { [](const Common::KeyState &ks) { if (ks.keycode == Common::KEYCODE_0) { g_events->focusedView()->close(); - none160(); + g_maps->_currentMap->none160(); } else if (ks.keycode == Common::KEYCODE_2) { g_events->focusedView()->close(); g_events->send(SoundMessage( diff --git a/engines/mm/mm1/maps/map21.cpp b/engines/mm/mm1/maps/map21.cpp index b6aadf2fcd0..a89a04dd5e3 100644 --- a/engines/mm/mm1/maps/map21.cpp +++ b/engines/mm/mm1/maps/map21.cpp @@ -136,12 +136,12 @@ void Map21::special02() { g_events->send(SoundMessage(STRING["maps.map21.not_enough_gold"])); g_maps->_mapPos.y++; - updateGame(); + g_maps->_currentMap->updateGame(); } else if (ks.keycode == Common::KEYCODE_n) { g_events->close(); g_maps->_mapPos.y++; - updateGame(); + g_maps->_currentMap->updateGame(); } } )); diff --git a/engines/mm/mm1/maps/map23.cpp b/engines/mm/mm1/maps/map23.cpp index b22ad0ca9eb..3f1d3da1370 100644 --- a/engines/mm/mm1/maps/map23.cpp +++ b/engines/mm/mm1/maps/map23.cpp @@ -116,7 +116,7 @@ void Map23::special08() { []() { g_maps->_mapPos = Common::Point( getRandomNumber(15), getRandomNumber(15)); - updateGame(); + g_maps->_currentMap->updateGame(); } )); } diff --git a/engines/mm/mm1/maps/map24.cpp b/engines/mm/mm1/maps/map24.cpp index 27306775f9a..813832b3d75 100644 --- a/engines/mm/mm1/maps/map24.cpp +++ b/engines/mm/mm1/maps/map24.cpp @@ -61,7 +61,7 @@ void Map24::special01() { Map24 &map = *static_cast(g_maps->_currentMap); if (!map.addItem(MAP_OF_DESERT_ID)) { g_maps->clearSpecial(); - none160(); + map.none160(); } } ); @@ -145,7 +145,7 @@ void Map24::special09() { c._backpack[1]._id = PIRATES_MAP_B_ID; g_maps->clearSpecial(); - none160(); + g_maps->_currentMap->none160(); } )); } diff --git a/engines/mm/mm1/maps/map28.cpp b/engines/mm/mm1/maps/map28.cpp index 9652be5000d..6e552afb88d 100644 --- a/engines/mm/mm1/maps/map28.cpp +++ b/engines/mm/mm1/maps/map28.cpp @@ -120,7 +120,7 @@ void Map28::special() { g_events->send(SoundMessage(STRING["maps.map28.poof"])); g_maps->_mapPos = Common::Point( getRandomNumber(15), getRandomNumber(15)); - updateGame(); + map.updateGame(); break; default: diff --git a/engines/mm/mm1/maps/map29.cpp b/engines/mm/mm1/maps/map29.cpp index e229ace4dbf..1572ca4cd3e 100644 --- a/engines/mm/mm1/maps/map29.cpp +++ b/engines/mm/mm1/maps/map29.cpp @@ -115,7 +115,7 @@ void Map29::special01() { if (ks.keycode == Common::KEYCODE_y) { g_events->close(); g_maps->_mapPos = Common::Point(12, 12); - updateGame(); + g_maps->_currentMap->updateGame(); } else if (ks.keycode == Common::KEYCODE_n) { Game::Encounter &enc = g_globals->_encounters; Map29 &map = *static_cast(g_maps->_currentMap); @@ -208,7 +208,7 @@ void Map29::begone() { g_maps->_mapPos.y = 7; SoundMessage msg(STRING["maps.map29.begone"], []() { - updateGame(); + g_maps->_currentMap->updateGame(); } ); msg._delaySeconds = 2; diff --git a/engines/mm/mm1/maps/map30.cpp b/engines/mm/mm1/maps/map30.cpp index 008085b2136..2c6fbcffe76 100644 --- a/engines/mm/mm1/maps/map30.cpp +++ b/engines/mm/mm1/maps/map30.cpp @@ -110,7 +110,7 @@ void Map30::special03() { MAX((int)c._age._base - 20, 18); } - none160(); + g_maps->_currentMap->none160(); } )); } diff --git a/engines/mm/mm1/maps/map32.cpp b/engines/mm/mm1/maps/map32.cpp index ec4e25e7ddc..1ec47d1737f 100644 --- a/engines/mm/mm1/maps/map32.cpp +++ b/engines/mm/mm1/maps/map32.cpp @@ -96,11 +96,11 @@ void Map32::special02() { if (ks.keycode == Common::KEYCODE_y) { g_events->close(); map[VAL2] = 0xff; - updateGame(); + map.updateGame(); } else if (ks.keycode == Common::KEYCODE_n) { g_events->close(); map[VAL2]++; - updateGame(); + map.updateGame(); } } ));