From b3f437fe5592739d7018be0dd3e4661c7cbe510a Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 6 Sep 2021 18:28:28 -0700 Subject: [PATCH] Rename `respawncolour` to `savecolour` Since it's a variable like saverx/savery/savex/savey, it should be renamed to savecolour and placed with all of them. --- desktop_version/src/Game.cpp | 15 +++++++-------- desktop_version/src/Game.h | 3 +-- desktop_version/src/Map.cpp | 2 +- desktop_version/src/Script.cpp | 5 ++--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 69ebafd3..a9824fdd 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -156,6 +156,7 @@ void Game::init(void) prevroomy = 0; saverx = 0; savery = 0; + savecolour = 0; mutebutton = 0; muted = false; @@ -363,8 +364,6 @@ void Game::init(void) disableaudiopause = false; disabletemporaryaudiopause = true; inputdelay = false; - - respawncolour = 0; } void Game::lifesequence(void) @@ -5124,6 +5123,10 @@ void Game::customloadquick(const std::string& savfile) { savepoint = help.Int(pText); } + else if (SDL_strcmp(pKey, "savecolour") == 0) + { + savecolour = help.Int(pText); + } else if (SDL_strcmp(pKey, "companion") == 0) { companion = help.Int(pText); @@ -5200,10 +5203,6 @@ void Game::customloadquick(const std::string& savfile) { map.showtrinkets = help.Int(pText); } - else if (SDL_strcmp(pKey, "respawncolour") == 0) - { - respawncolour = help.Int(pText); - } } @@ -5632,6 +5631,8 @@ bool Game::customsavequick(const std::string& savfile) xml::update_tag(msgs, "savepoint", savepoint); + xml::update_tag(msgs, "savecolour", savecolour); + xml::update_tag(msgs, "trinkets", trinkets()); xml::update_tag(msgs, "crewmates", crewmates()); @@ -5676,8 +5677,6 @@ bool Game::customsavequick(const std::string& savfile) xml::update_tag(msgs, "showtrinkets", (int) map.showtrinkets); - xml::update_tag(msgs, "respawncolour", respawncolour); - std::string summary = savearea + ", " + timestring(); xml::update_tag(msgs, "summary", summary.c_str()); diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index e5d10fb8..a79e8e63 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -220,6 +220,7 @@ public: int savex, savey, saverx, savery; int savegc, savedir; + int savecolour; //Added for port int edsavex, edsavey, edsaverx, edsavery; @@ -481,8 +482,6 @@ public: bool disableaudiopause; bool disabletemporaryaudiopause; bool inputdelay; - - int respawncolour; }; #ifndef GAME_DEFINITION diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index e11acc85..5c259802 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -833,7 +833,7 @@ void mapclass::resetplayer(const bool player_died) obj.entities[i].newyp = obj.entities[i].yp; obj.entities[i].dir = game.savedir; - obj.entities[i].colour = game.respawncolour; + obj.entities[i].colour = game.savecolour; if (player_died) { game.lifeseq = 10; diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 8a50465f..30daed4b 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1674,7 +1674,7 @@ void scriptclass::run(void) } else if (words[0] == "changerespawncolour") { - game.respawncolour = getcolorfromname(words[1]); + game.savecolour = getcolorfromname(words[1]); } else if (words[0] == "altstates") { @@ -3130,6 +3130,7 @@ void scriptclass::hardreset(void) game.saverx = 0; game.savery = 0; } + game.savecolour = 0; game.intimetrial = false; game.timetrialcountdown = 0; @@ -3188,8 +3189,6 @@ void scriptclass::hardreset(void) game.disabletemporaryaudiopause = true; - game.respawncolour = 0; - //dwgraphicsclass graphics.backgrounddrawn = false; graphics.textbox.clear();