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

Method getCreatureSpeedDefault

source/entities/Tile.cpp:1812–1834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1810}
1811
1812double Tile::getCreatureSpeedDefault(const Creature* creature) const
1813{
1814 // If we are on a full tile, we set the speed to ground speed. That can happen
1815 // on client side if there is a desynchro between server and client and the
1816 // creature is not exactly on the same tile
1817 if(!getIsOnServerMap() && isFullTile())
1818 return creature->getMoveSpeedGround();
1819
1820 switch(getTileVisual())
1821 {
1822 case TileVisual::dirtGround:
1823 case TileVisual::goldGround:
1824 case TileVisual::rockGround:
1825 case TileVisual::claimedGround:
1826 return creature->getMoveSpeedGround();
1827 case TileVisual::waterGround:
1828 return creature->getMoveSpeedWater();
1829 case TileVisual::lavaGround:
1830 return creature->getMoveSpeedLava();
1831 default:
1832 return 0.0;
1833 }
1834}
1835
1836bool Tile::canWorkerClaim(const Creature& worker)
1837{

Callers 3

getCreatureSpeedMethod · 0.80
getMoveSpeedMethod · 0.80
getCreatureSpeedMethod · 0.80

Calls 3

getMoveSpeedGroundMethod · 0.45
getMoveSpeedWaterMethod · 0.45
getMoveSpeedLavaMethod · 0.45

Tested by

no test coverage detected