Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. void House::updateDoorDescription(std::string _name/* = ""*/, Door* door/* = NULL*/)
  2. {
  3. int32_t house_tiles = (price / g_config.getNumber(ConfigManager::HOUSE_PRICE));
  4. std::string tmp = "house";
  5. if(isGuild())
  6. tmp = "hall";
  7.  
  8. char houseDescription[250];
  9. if(owner)
  10. {
  11. if(isGuild())
  12. IOGuild::getInstance()->getGuildById(_name, owner);
  13. else if(_name.empty())
  14. IOLoginData::getInstance()->getNameByGuid(owner, _name);
  15.  
  16. sprintf(houseDescription, "It belongs to %s '%s'. %s owns this %s. It has %d tiles.", tmp.c_str(), name.c_str(), _name.c_str(), tmp.c_str(), house_tiles);
  17. }
  18. else
  19. sprintf(houseDescription, "It belongs to %s '%s'. Nobody owns this %s. It costs %d gold coins. It has %d tiles.", tmp.c_str(), name.c_str(), tmp.c_str(), price, house_tiles);
  20.  
  21. if(!door)
  22. {
  23. for(HouseDoorList::iterator it = doorList.begin(); it != doorList.end(); ++it)
  24. (*it)->setSpecialDescription(houseDescription);
  25. }
  26. else
  27. door->setSpecialDescription(houseDescription);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement