miscs: movement, coredump fix, rndbot

This commit is contained in:
Yunfan Li
2023-08-02 16:16:56 +08:00
parent fca4d17c97
commit 46b94824e4
15 changed files with 108 additions and 53 deletions

View File

@@ -596,8 +596,10 @@ bool SapphironFlightPositionAction::MoveToNearestIcebolt()
}
if (playerWithIcebolt) {
Unit* boss = AI_VALUE2(Unit*, "find target", "sapphiron");
float angle = boss->GetAngle(playerWithIcebolt);
return MoveTo(NAXX_MAP_ID, playerWithIcebolt->GetPositionX() + cos(angle) * 3.0f, playerWithIcebolt->GetPositionY() + sin(angle) * 3.0f, helper.GENERIC_HEIGHT);
if (boss) {
float angle = boss->GetAngle(playerWithIcebolt);
return MoveTo(NAXX_MAP_ID, playerWithIcebolt->GetPositionX() + cos(angle) * 3.0f, playerWithIcebolt->GetPositionY() + sin(angle) * 3.0f, helper.GENERIC_HEIGHT);
}
}
return false;
}

View File

@@ -22,7 +22,7 @@ class GenericBossHelper : public AiObject {
public:
GenericBossHelper(PlayerbotAI* botAI, std::string name): AiObject(botAI), name_(name) {}
virtual bool UpdateBossAI() {
if(unit_ && !unit_->IsInWorld()) {
if(unit_ && (!unit_->IsInWorld() || !unit_->IsAlive())) {
unit_ = nullptr;
}
if (!unit_) {