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

Method restoreInitialEntityState

source/rooms/RoomPortalWave.cpp:656–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656void RoomPortalWave::restoreInitialEntityState()
657{
658 // We need to use seats with vision before calling Room::restoreInitialEntityState
659 // because it will empty the list
660 if(mPortalObject == nullptr)
661 {
662 OD_LOG_ERR("RoomPortalWave=" + getName());
663 return;
664 }
665
666 Tile* tilePortalObject = mPortalObject->getPositionTile();
667 if(tilePortalObject == nullptr)
668 {
669 OD_LOG_ERR("RoomPortalWave=" + getName() + ", mPortalObject=" + mPortalObject->getName());
670 return;
671 }
672 TileData* tileData = mTileData[tilePortalObject];
673 if(tileData == nullptr)
674 {
675 OD_LOG_ERR("RoomPortalWave=" + getName() + ", tile=" + Tile::displayAsString(tilePortalObject));
676 return;
677 }
678
679 if(!tileData->mSeatsVision.empty())
680 mPortalObject->notifySeatsWithVision(tileData->mSeatsVision);
681
682 // If there are no covered tile, the temple object is not working
683 if(numCoveredTiles() == 0)
684 mPortalObject->notifyRemoveAsked();
685
686 Room::restoreInitialEntityState();
687}
688
689void RoomPortalWave::addRoomPortalWaveData(RoomPortalWaveData* roomPortalWaveData)
690{

Callers

nothing calls this directly

Calls 3

getPositionTileMethod · 0.80
notifySeatsWithVisionMethod · 0.45
notifyRemoveAskedMethod · 0.45

Tested by

no test coverage detected