otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.59k stars 1.06k forks source link

Fleeing Animals Delaying #316

Closed Ezzz-dev closed 10 years ago

Ezzz-dev commented 10 years ago

Fleeing Animals delay for 1 second everytime they move.

Tested with Rabbit and Deer, fleeing works normally with other monsters like e.g; Amazon.

Setting the animal as hostile can make it work but you will get the swords.

marksamman commented 10 years ago

It's intentional.

If you want to change it, you should look at https://github.com/otland/forgottenserver/blob/master/src/creature.cpp#L1483 and bool Monster::getDistanceStep(const Position& targetPos, Direction& dir, bool flee /* = false */)

Ezzz-dev commented 10 years ago

I have tried debugging it, even tried to keep stepDuration on a static value and it will still delay so the thing isn't really there but somewhere else, if you could tell me where is this delay happening as I can't seem to find it anywhere while debugging.

getDistanceStep, none of the stepDuration calls are being called while I debug and a Deer is fleeing.