diff --git a/src/client/map.cpp b/src/client/map.cpp index dc061ee8..343b0c2d 100644 --- a/src/client/map.cpp +++ b/src/client/map.cpp @@ -394,6 +394,14 @@ void Map::setZoneColor(tileflags_t zone, const Color& color) m_zoneColors[zone] = color; } +Color Map::getZoneColor(tileflags_t flag) +{ + auto it = m_zoneColors.find(flag); + if(it == m_zoneColors.end()) + return Color::alpha; + return it->second; +} + void Map::setForceShowAnimations(bool force) { if(force) { diff --git a/src/client/map.h b/src/client/map.h index f25c9749..8dca1134 100644 --- a/src/client/map.h +++ b/src/client/map.h @@ -196,7 +196,7 @@ public: void setZoneOpacity(float opacity) { m_zoneOpacity = opacity; } float getZoneOpacity() { return m_zoneOpacity; } - Color getZoneColor(tileflags_t flag) { return m_zoneColors[flag]; } + Color getZoneColor(tileflags_t flag); tileflags_t getZoneFlags() { return (tileflags_t)m_zoneFlags; } bool showZones() { return m_zoneFlags != 0; } bool showZone(tileflags_t zone) { return (m_zoneFlags & zone) == zone; } @@ -257,7 +257,7 @@ private: uint8 m_animationFlags; uint32 m_zoneFlags; - std::array m_zoneColors; + std::map m_zoneColors; float m_zoneOpacity; Light m_light; @@ -272,5 +272,3 @@ private: extern Map g_map; #endif - -/* vim: set ts=4 sw=4 et: */