| 246 | } |
| 247 | |
| 248 | void 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 | |
| 277 | void RoomTorture::doUpkeep() |
| 278 | { |