# By BrunoDCC # Via BrunoDCC * https://github.com/BrunoDCC/otclient: Fix houses and monsters
This commit is contained in:
commit
f02d5e7975
|
@ -111,8 +111,8 @@ void Spawn::save(TiXmlElement* node)
|
||||||
const Position& placePos = pair.first;
|
const Position& placePos = pair.first;
|
||||||
assert(placePos.isValid());
|
assert(placePos.isValid());
|
||||||
|
|
||||||
creatureNode->SetAttribute("x", c.x - placePos.x);
|
creatureNode->SetAttribute("x", placePos.x - c.x);
|
||||||
creatureNode->SetAttribute("y", c.y - placePos.y);
|
creatureNode->SetAttribute("y", placePos.y - c.y);
|
||||||
creatureNode->SetAttribute("z", placePos.z);
|
creatureNode->SetAttribute("z", placePos.z);
|
||||||
|
|
||||||
node->LinkEndChild(creatureNode);
|
node->LinkEndChild(creatureNode);
|
||||||
|
|
|
@ -109,7 +109,7 @@ void Map::loadOtbm(const std::string& fileName)
|
||||||
uint32 flags = TILESTATE_NONE;
|
uint32 flags = TILESTATE_NONE;
|
||||||
Position pos = basePos + nodeTile->getPoint();
|
Position pos = basePos + nodeTile->getPoint();
|
||||||
|
|
||||||
if(type == OTBM_HOUSETILE) {
|
if(type == OTBM_HOUSETILE) {
|
||||||
uint32 hId = nodeTile->getU32();
|
uint32 hId = nodeTile->getU32();
|
||||||
TilePtr tile = getOrCreateTile(pos);
|
TilePtr tile = getOrCreateTile(pos);
|
||||||
if(!(house = g_houses.getHouse(hId))) {
|
if(!(house = g_houses.getHouse(hId))) {
|
||||||
|
@ -136,9 +136,6 @@ void Map::loadOtbm(const std::string& fileName)
|
||||||
|
|
||||||
if((_flags & TILESTATE_REFRESH) == TILESTATE_REFRESH)
|
if((_flags & TILESTATE_REFRESH) == TILESTATE_REFRESH)
|
||||||
flags |= TILESTATE_REFRESH;
|
flags |= TILESTATE_REFRESH;
|
||||||
|
|
||||||
if((_flags & TILESTATE_HOUSE) == TILESTATE_HOUSE)
|
|
||||||
flags |= TILESTATE_HOUSE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OTBM_ATTR_ITEM: {
|
case OTBM_ATTR_ITEM: {
|
||||||
|
@ -179,9 +176,9 @@ void Map::loadOtbm(const std::string& fileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(const TilePtr& tile = getTile(pos)) {
|
if(const TilePtr& tile = getTile(pos)) {
|
||||||
if(tile->hasFlag(TILESTATE_HOUSE))
|
if(house)
|
||||||
tile->setFlags(tile->getFlags() & ~TILESTATE_HOUSE);
|
tile->setFlag(TILESTATE_HOUSE);
|
||||||
tile->setFlags((tileflags_t)flags);
|
tile->setFlag(flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(mapDataType == OTBM_TOWNS) {
|
} else if(mapDataType == OTBM_TOWNS) {
|
||||||
|
|
Loading…
Reference in New Issue