0x004BB432 bl = flags; esi = X86Pointer(&element); ax = pos.x; cx = pos.y;
| 1086 | // ax = pos.x; |
| 1087 | // cx = pos.y; |
| 1088 | void removeTree(World::TreeElement& element, const uint8_t flags, const World::Pos2& pos) |
| 1089 | { |
| 1090 | if ((!element.isGhost() && !element.isAiAllocated()) |
| 1091 | && GameCommands::getUpdatingCompanyId() != CompanyId::neutral) |
| 1092 | { |
| 1093 | auto loc = World::Pos3(pos.x, pos.y, element.baseHeight()); |
| 1094 | playDemolishTreeSound(loc); |
| 1095 | } |
| 1096 | |
| 1097 | if ((flags & GameCommands::Flags::ghost) == 0) |
| 1098 | { |
| 1099 | auto treeObj = ObjectManager::get<TreeObject>(element.treeObjectId()); |
| 1100 | auto ratingReduction = treeObj->demolishRatingReduction; |
| 1101 | TownManager::updateTownInfo(pos, 0, 0, ratingReduction, 0); |
| 1102 | } |
| 1103 | |
| 1104 | auto zMin = element.baseHeight(); |
| 1105 | auto zMax = element.clearHeight(); |
| 1106 | Ui::ViewportManager::invalidate(pos, zMin, zMax, ZoomLevel::eighth, 56); |
| 1107 | |
| 1108 | World::TileManager::removeElement(*reinterpret_cast<World::TileElement*>(&element)); |
| 1109 | } |
| 1110 | |
| 1111 | // 0x0048B0C7 |
| 1112 | void createDestructExplosion(const World::Pos3& pos) |
no test coverage detected