| 3016 | } |
| 3017 | |
| 3018 | void 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 | |
| 3044 | void Creature::setJobCooldown(int val) |
| 3045 | { |