Simplify mapclass::currentarea()

It used to take a single int: the area number returned by
mapclass::area(roomx, roomy). All uses of currentarea() were called
with an extra area() call as its argument. Additionally, there's a
good reason why currentarea() should have the room coordinates: in one
of the cases that it's called, there's a special case for the ship's
coordinates. This results in the SAVE screen in the map menu being able
to show "The Ship", while the continue screen shows "Dimension VVVVVV"
instead. Therefore, why not put that exception inside currentarea()
instead, and remove a few callsite map.area() wrappers by making
currentarea() take the room x and y coordinates?
This commit is contained in:
Dav999
2023-09-12 00:07:10 +02:00
committed by Misa Elizabeth Kai
parent 73911a7ada
commit 89a165722e
4 changed files with 11 additions and 12 deletions

View File

@@ -3068,11 +3068,9 @@ static void mapmenuactionpress(const bool version2_2)
music.playef(Sound_GAMESAVED);
game.savetime = game.timestring();
game.savearea = map.currentarea(map.area(game.roomx, game.roomy));
game.savearea = map.currentarea(game.roomx, game.roomy);
game.savetrinkets = game.trinkets();
if (game.roomx >= 102 && game.roomx <= 104 && game.roomy >= 110 && game.roomy <= 111) game.savearea = loc::gettext_roomname_special("The Ship");
bool success;
if(map.custommodeforreal)