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

Method checkWalkPathValid

source/entities/Creature.cpp:3018–3042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3016}
3017
3018void Creature::checkWalkPathValid()
3019{
3020 bool stop = false;
3021 for(const Ogre::Vector3& dest : mWalkQueue)
3022 {
3023 Tile* tile = getGameMap()->getTile(Helper::round(dest.x), Helper::round(dest.y));
3024 if(tile == nullptr)
3025 {
3026 stop = true;
3027 break;
3028 }
3029
3030 if(!canGoThroughTile(tile))
3031 {
3032 stop = true;
3033 break;
3034 }
3035 }
3036
3037 if(!stop)
3038 return;
3039
3040 // There is an unpassable tile in our way. We stop what we are doing
3041 clearDestinations(EntityAnimation::idle_anim, true, true);
3042}
3043
3044void Creature::setJobCooldown(int val)
3045{

Callers 1

doorLockMethod · 0.80

Calls 2

roundFunction · 0.85
getTileMethod · 0.45

Tested by

no test coverage detected