Browse Source

don't set bits twice

Ahmed Samy 7 years ago
parent
commit
2b015d49d7
2 changed files with 3 additions and 2 deletions
  1. 1
    0
      src/client/houses.cpp
  2. 2
    2
      src/client/mapio.cpp

+ 1
- 0
src/client/houses.cpp View File

@@ -41,6 +41,7 @@ House::House(uint32 hId, const std::string &name, const Position &pos)
41 41
 void House::setTile(const TilePtr& tile)
42 42
 {
43 43
     tile->setFlag(TILESTATE_HOUSE);
44
+    tile->setHouseId(getId());
44 45
     m_tiles.insert(std::make_pair(tile->getPosition(), tile));
45 46
 }
46 47
 

+ 2
- 2
src/client/mapio.cpp View File

@@ -179,8 +179,8 @@ void Map::loadOtbm(const std::string& fileName)
179 179
                     }
180 180
 
181 181
                     if(const TilePtr& tile = getTile(pos)) {
182
-                        if(house)
183
-                            tile->setHouseId(house->getId());
182
+                        if(tile->hasFlag(TILESTATE_HOUSE))
183
+                            tile->setFlags(tile->getFlags() & ~TILESTATE_HOUSE);
184 184
                         tile->setFlags((tileflags_t)flags);
185 185
                     }
186 186
                 }

Loading…
Cancel
Save