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

Method fillWithCarryableEntities

source/entities/Tile.cpp:1395–1415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1393}
1394
1395void 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
1417bool Tile::isEntityOnTile(GameEntity* entity) const
1418{

Callers 2

getCarryableEntitiesMethod · 0.80
dropMethod · 0.80

Calls 2

getCarryLockMethod · 0.80
getEntityCarryTypeMethod · 0.45

Tested by

no test coverage detected