Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. int64_t Creature::getTimeSinceLastMove() const
  2. {
  3. if (lastStep) {
  4. return OTSYS_TIME() - lastStep;
  5. }
  6. return std::numeric_limits<int64_t>::max();
  7. }
  8.  
  9. int32_t Creature::getWalkDelay(Direction dir) const
  10. {
  11. if (lastStep == 0) {
  12. return 0;
  13. }
  14.  
  15. int64_t ct = OTSYS_TIME();
  16. int64_t stepDuration = getStepDuration(dir);
  17. return stepDuration - (ct - lastStep);
  18. }
  19.  
  20. int32_t Creature::getWalkDelay() const
  21. {
  22. //Used for auto-walking
  23. if (lastStep == 0) {
  24. return 0;
  25. }
  26.  
  27. int64_t ct = OTSYS_TIME();
  28. int64_t stepDuration = getStepDuration() * lastStepCost;
  29. return stepDuration - (ct - lastStep);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement