summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-24 19:17:41 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-02 20:57:16 +0200
commit59919635523d41f3a15120c83db4b7d080c155de (patch)
tree0da989bd2342b5a53d49c26893a3a544e7432fcc /src/game.cpp
parent7ea1c4574d6e845f95f2c4c3a1dd4a5d730bc6ba (diff)
downloadmana-59919635523d41f3a15120c83db4b7d080c155de.tar.gz
mana-59919635523d41f3a15120c83db4b7d080c155de.tar.bz2
mana-59919635523d41f3a15120c83db4b7d080c155de.tar.xz
mana-59919635523d41f3a15120c83db4b7d080c155de.zip
General code cleanups
* Removed some unused includes * Removed unused ListBox::mFont * Removed wrong cast to SDL_Scancode * Removed superfluous .c_str() * Removed superfluous explicit std::string construction * Removed unused variable * Use more emplace_back * Turned FindBeingFunctor into a lambda * Avoid needless pointer references for ambient layers and use a vector
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp
index acf2d5a2..a9199817 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -206,9 +206,7 @@ static void destroyGuiWindows()
Game *Game::mInstance = nullptr;
Game::Game():
- mLastTarget(ActorSprite::UNKNOWN),
- mDisconnected(false),
- mCurrentMap(nullptr)
+ mLastTarget(ActorSprite::UNKNOWN)
{
assert(!mInstance);
mInstance = this;
@@ -946,8 +944,8 @@ void Game::changeMap(const std::string &mapPath)
newMap->initializeParticleEffects(particleEngine);
// Start playing new music file when necessary
- std::string oldMusic = mCurrentMap ? mCurrentMap->getMusicFile() : "";
- std::string newMusic = newMap ? newMap->getMusicFile() : "";
+ std::string oldMusic = mCurrentMap ? mCurrentMap->getMusicFile() : std::string();
+ std::string newMusic = newMap ? newMap->getMusicFile() : std::string();
if (newMusic != oldMusic)
{
if (newMusic.empty())