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

Method tryDrop

source/entities/ChickenEntity.cpp:218–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218bool ChickenEntity::tryDrop(Seat* seat, Tile* tile)
219{
220 if (tile->isFullTile())
221 return false;
222
223 // In editor mode, we allow to drop an object in dirt, claimed or gold tiles
224 if(getGameMap()->isInEditorMode() &&
225 (tile->getTileVisual() == TileVisual::dirtGround || tile->getTileVisual() == TileVisual::goldGround || tile->getTileVisual() == TileVisual::rockGround))
226 {
227 return true;
228 }
229
230 // we cannot drop a chicken on a tile we don't see
231 if(!seat->hasVisionOnTile(tile))
232 return false;
233
234 // Otherwise, we allow to drop an object only on allied claimed tiles
235 if(tile->isClaimedForSeat(seat))
236 return true;
237
238 return false;
239}
240
241void ChickenEntity::correctEntityMovePosition(Ogre::Vector3& position)
242{

Callers

nothing calls this directly

Calls 5

isFullTileMethod · 0.80
isInEditorModeMethod · 0.80
getTileVisualMethod · 0.80
hasVisionOnTileMethod · 0.80
isClaimedForSeatMethod · 0.80

Tested by

no test coverage detected