MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / updateActiveSpots

Method updateActiveSpots

source/rooms/RoomPortalWave.cpp:204–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void 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
236void RoomPortalWave::updatePortalPosition()
237{

Callers

nothing calls this directly

Calls 1

isInEditorModeMethod · 0.80

Tested by

no test coverage detected