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

Method removeCreatureUsingRoom

source/rooms/RoomTorture.cpp:248–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void RoomTorture::removeCreatureUsingRoom(Creature* creature)
249{
250 Room::removeCreatureUsingRoom(creature);
251
252 // If the creature leaving the casino left another one playing alone, we
253 // should search for another creature alone and try to make them match
254 RoomTortureCreatureInfo* infoToUse = nullptr;
255 for(std::pair<Tile* const,RoomTortureCreatureInfo>& p : mCreaturesSpots)
256 {
257 if(p.second.mCreature != creature)
258 continue;
259
260 infoToUse = &p.second;
261 break;
262 }
263
264 if(infoToUse == nullptr)
265 {
266 OD_LOG_ERR("room=" + getName() + ", creature=" + creature->getName());
267 return;
268 }
269
270 creature->setInJail(nullptr);
271
272 infoToUse->mCreature = nullptr;
273 infoToUse->mIsReady = false;
274 infoToUse->mState = 0;
275}
276
277void RoomTorture::doUpkeep()
278{

Callers

nothing calls this directly

Calls 1

setInJailMethod · 0.80

Tested by

no test coverage detected