Advertisement
Guest User

Untitled

a guest
Feb 28th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int32_t Creature::getStepDuration() const
  2. {
  3. if(isRemoved())
  4. return 0;
  5.  
  6. int32_t duration = 0;
  7. const Tile* tile = getTile();
  8. if(tile && tile->ground)
  9. {
  10. uint32_t groundId = tile->ground->getID();
  11. uint16_t groundSpeed = Item::items[groundId].speed;
  12. uint32_t stepSpeed = getStepSpeed();
  13. if(stepSpeed != 0)
  14. duration = (1000 * groundSpeed) / stepSpeed;
  15. }
  16. return duration * lastStepCost;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement