| 202 | } |
| 203 | |
| 204 | void RoomPortalWave::updateActiveSpots() |
| 205 | { |
| 206 | // Room::updateActiveSpots(); <<-- Disabled on purpose. |
| 207 | // We don't update the active spots the same way as only the central tile is needed. |
| 208 | if (getGameMap()->isInEditorMode()) |
| 209 | updatePortalPosition(); |
| 210 | else |
| 211 | { |
| 212 | if(mPortalObject == nullptr) |
| 213 | { |
| 214 | // We check if the portal already exists (that can happen if it has |
| 215 | // been restored after restoring a saved game) |
| 216 | if(mBuildingObjects.empty()) |
| 217 | updatePortalPosition(); |
| 218 | else |
| 219 | { |
| 220 | for(auto& p : mBuildingObjects) |
| 221 | { |
| 222 | if(p.second == nullptr) |
| 223 | continue; |
| 224 | |
| 225 | // We take the first BuildingObject. Note that we cannot use |
| 226 | // the central tile because after saving a game, the central tile may |
| 227 | // not be the same if some tiles have been destroyed |
| 228 | mPortalObject = p.second; |
| 229 | break; |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | void RoomPortalWave::updatePortalPosition() |
| 237 | { |
nothing calls this directly
no test coverage detected