mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-15 18:00:27 +00:00
miscs: movement, coredump fix, rndbot
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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_) {
|
||||
|
||||
Reference in New Issue
Block a user