| 240 | } |
| 241 | |
| 242 | bool RoomArena::useRoom(Creature& creature, bool forced) |
| 243 | { |
| 244 | // If the creature is alone, it should wander in the room. If it is not, it should wait until there is one ready |
| 245 | if(mCreaturesFighting.size() < 2) |
| 246 | { |
| 247 | std::vector<Tile*> tiles = getCoveredTiles(); |
| 248 | if(tiles.empty()) |
| 249 | { |
| 250 | OD_LOG_ERR("room=" + getName() + ", creature=" + creature.getName()); |
| 251 | return false; |
| 252 | } |
| 253 | |
| 254 | uint32_t index = Random::Uint(0, tiles.size() - 1); |
| 255 | Tile* tile = tiles[index]; |
| 256 | if(!creature.setDestination(tile)) |
| 257 | { |
| 258 | OD_LOG_ERR("room=" + getName() + ", creature=" + creature.getName() + ", tile=" + Tile::displayAsString(tile)); |
| 259 | return false; |
| 260 | } |
| 261 | return false; |
| 262 | } |
| 263 | |
| 264 | // We do nothing while waiting |
| 265 | return false; |
| 266 | } |
| 267 | |
| 268 | BuildingObject* RoomArena::notifyActiveSpotCreated(ActiveSpotPlace place, Tile* tile) |
| 269 | { |
nothing calls this directly
no test coverage detected