| 164 | } |
| 165 | |
| 166 | void WorldServer::removeCentralStructure() { |
| 167 | for (auto const& structureObject : m_centralStructure.objects()) { |
| 168 | if (!structureObject.residual) { |
| 169 | generateRegion(RectI::withSize(structureObject.position, {1, 1})); |
| 170 | for (auto const& objectEntity : atTile<Object>(structureObject.position)) { |
| 171 | if (objectEntity->tilePosition() == structureObject.position && objectEntity->name() == structureObject.name) |
| 172 | removeEntity(objectEntity->entityId(), false); |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | for (auto const& backgroundBlock : m_centralStructure.backgroundBlocks()) { |
| 178 | if (!backgroundBlock.residual) { |
| 179 | generateRegion(RectI::withSize(backgroundBlock.position, {1, 1})); |
| 180 | if (auto tile = m_tileArray->modifyTile(backgroundBlock.position)) { |
| 181 | if (tile->background == backgroundBlock.materialId) { |
| 182 | tile->background = EmptyMaterialId; |
| 183 | tile->backgroundMod = NoModId; |
| 184 | queueTileUpdates(backgroundBlock.position); |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | for (auto const& foregroundBlock : m_centralStructure.foregroundBlocks()) { |
| 191 | if (!foregroundBlock.residual) { |
| 192 | generateRegion(RectI::withSize(foregroundBlock.position, {1, 1})); |
| 193 | if (auto tile = m_tileArray->modifyTile(foregroundBlock.position)) { |
| 194 | if (tile->foreground == foregroundBlock.materialId) { |
| 195 | tile->foreground = EmptyMaterialId; |
| 196 | tile->foregroundMod = NoModId; |
| 197 | tile->updateCollision(CollisionKind::None); |
| 198 | dirtyCollision(RectI::withSize(foregroundBlock.position, {1, 1})); |
| 199 | queueTileUpdates(foregroundBlock.position); |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | bool WorldServer::spawnTargetValid(SpawnTarget const& spawnTarget) const { |
| 207 | if (spawnTarget.is<SpawnTargetUniqueEntity>()) |
nothing calls this directly
no test coverage detected