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

Method notifyRemoveAsked

source/entities/PersistentObject.cpp:164–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164bool PersistentObject::notifyRemoveAsked()
165{
166 mIsWorking = false;
167 // If at least 1 player has vision on this PersistentObject, we cannot remove it
168 // from gamemap.
169 // We check if there is at least 1 seat that have been notified previously and
170 // lost vision
171 for(Seat* seat : mSeatsAlreadyNotifiedOnce)
172 {
173 auto it = std::find(mSeatsWithVisionNotified.begin(), mSeatsWithVisionNotified.end(), seat);
174 if(it != mSeatsWithVisionNotified.end())
175 continue;
176
177 // There is at least 1 seat that have seen the PersistentObject but not currently
178 // have vision on it. We cannot remove it
179 return false;
180 }
181
182 return true;
183}

Callers 6

doUpkeepMethod · 0.45
updateActiveSpotsMethod · 0.45
canBuildingBeRemovedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected