swap map to array
This commit is contained in:
parent
a3c65f3a7e
commit
6a17173d08
|
@ -232,12 +232,9 @@ void Map::removeThing(const ThingPtr& thing)
|
|||
return;
|
||||
|
||||
if(MissilePtr shot = thing->asMissile()) {
|
||||
m_missilesAtFloor[shot->getPosition().z];
|
||||
for(auto it = m_missilesAtFloor[shot->getPosition().z].begin(), end = m_missilesAtFloor[shot->getPosition().z].end(); it != end; ++it) {
|
||||
if(shot == *it) {
|
||||
m_missilesAtFloor[shot->getPosition().z].erase(it);
|
||||
break;
|
||||
}
|
||||
auto it = std::find(m_missilesAtFloor[shot->getPosition().z].begin(), m_missilesAtFloor[shot->getPosition().z].end(), shot);
|
||||
if(it != m_missilesAtFloor[shot->getPosition().z].end()) {
|
||||
m_missilesAtFloor[shot->getPosition().z].erase(it);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
private:
|
||||
std::unordered_map<Position, TilePtr, PositionHasher> m_tiles;
|
||||
std::map<uint32, CreaturePtr> m_creatures;
|
||||
std::map<int, std::vector<MissilePtr> > m_missilesAtFloor;
|
||||
std::array<std::vector<MissilePtr>, MAX_Z> m_missilesAtFloor;
|
||||
|
||||
Light m_light;
|
||||
Position m_centralPosition;
|
||||
|
|
Loading…
Reference in New Issue