ZhengPeiRu21 / mod-playerbots

AzerothCore Playerbots Module
MIT License
194 stars 92 forks source link

Fix the sitting state and solve the problem that the bot will stuck after eating or drinking #192

Closed liyunfan1223 closed 1 year ago

liyunfan1223 commented 1 year ago

https://github.com/ZhengPeiRu21/mod-playerbots/commit/9871cd34c46c661327ae333e5bce0fb67135789d

The bot gets stuck after eating or drinking. Problems are mentioned in these issues:

That is caused by the misusing of StandState related method. Replace bot->AddUnitState(UNIT_STAND_STATE_SIT) with bot->SetStandState(UNIT_STAND_STATE_SIT) and it should work.

Actually bot->AddUnitState(UNIT_STAND_STATE_SIT) is equal to bot->AddUnitState(UNIT_STATE_DIED) because UNIT_STATE_DIED=UNIT_STAND_STATE_SIT=1, which may cause the bot to be considered dead and prevent it from moving. (not sure)