| 1393 | } |
| 1394 | |
| 1395 | void Tile::fillWithCarryableEntities(Creature* carrier, std::vector<GameEntity*>& entities) |
| 1396 | { |
| 1397 | for(GameEntity* entity : mEntitiesInTile) |
| 1398 | { |
| 1399 | if(entity == nullptr) |
| 1400 | { |
| 1401 | OD_LOG_ERR("unexpected null entity in tile=" + Tile::displayAsString(this)); |
| 1402 | continue; |
| 1403 | } |
| 1404 | |
| 1405 | // We check if the entity is already being handled by another creature |
| 1406 | if(entity->getCarryLock(*carrier)) |
| 1407 | continue; |
| 1408 | |
| 1409 | if(entity->getEntityCarryType(carrier) == EntityCarryType::notCarryable) |
| 1410 | continue; |
| 1411 | |
| 1412 | if (std::find(entities.begin(), entities.end(), entity) == entities.end()) |
| 1413 | entities.push_back(entity); |
| 1414 | } |
| 1415 | } |
| 1416 | |
| 1417 | bool Tile::isEntityOnTile(GameEntity* entity) const |
| 1418 | { |
no test coverage detected