summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/palettedb.cpp7
-rw-r--r--src/resources/db/palettedb.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/resources/db/palettedb.cpp b/src/resources/db/palettedb.cpp
index 4da058d2a..a3caf62dc 100644
--- a/src/resources/db/palettedb.cpp
+++ b/src/resources/db/palettedb.cpp
@@ -34,7 +34,6 @@ namespace
{
bool mLoaded = false;
std::map<std::string, DyeColor> mColors;
- DyeColor mEmpty(0, 0, 0, 0);
}
void PaletteDB::load()
@@ -113,11 +112,11 @@ void PaletteDB::unload()
mColors.clear();
}
-const DyeColor &PaletteDB::getColor(const std::string &name)
+const DyeColor *PaletteDB::getColor(const std::string &name)
{
std::map<std::string, DyeColor>::const_iterator it = mColors.find(name);
if (it != mColors.end())
- return (*it).second;
+ return &(*it).second;
else
- return mEmpty;
+ return nullptr;
}
diff --git a/src/resources/db/palettedb.h b/src/resources/db/palettedb.h
index 6043d14b7..349f863f5 100644
--- a/src/resources/db/palettedb.h
+++ b/src/resources/db/palettedb.h
@@ -32,7 +32,7 @@ namespace PaletteDB
void load();
void unload();
void loadPalette();
- const DyeColor &getColor(const std::string &name);
+ const DyeColor *getColor(const std::string &name);
} // namespace PaletteDB