mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-06 12:17:47 +00:00
coredump fix & rpg actions
This commit is contained in:
@@ -38,7 +38,7 @@ class FindBuffVisitor : public IterateItemsVisitor
|
||||
return true;
|
||||
|
||||
Item* itemForSpell = *GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue<Item*>("item for spell", spellId);
|
||||
if (itemForSpell && itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
|
||||
if (itemForSpell && itemForSpell->IsInWorld() && itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
|
||||
return true;
|
||||
|
||||
if (items.find(proto->SubClass) == items.end())
|
||||
|
||||
@@ -63,10 +63,10 @@ bool CastSpellAction::Execute(Event event)
|
||||
bool CastSpellAction::isPossible()
|
||||
{
|
||||
if (botAI->IsInVehicle() && !botAI->IsInVehicle(false, false, true)) {
|
||||
if (!sPlayerbotAIConfig->logInGroupOnly || bot->GetGroup()) {
|
||||
LOG_DEBUG("playerbots", "Can cast spell failed. Vehicle. - bot name: {}",
|
||||
bot->GetName());
|
||||
}
|
||||
// if (!sPlayerbotAIConfig->logInGroupOnly || bot->GetGroup()) {
|
||||
// LOG_DEBUG("playerbots", "Can cast spell failed. Vehicle. - bot name: {}",
|
||||
// bot->GetName());
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ bool CastSpellAction::isPossible()
|
||||
|
||||
if (spell == "mount" && bot->IsInCombat())
|
||||
{
|
||||
if (!sPlayerbotAIConfig->logInGroupOnly || bot->GetGroup()) {
|
||||
LOG_DEBUG("playerbots", "Can cast spell failed. Mount. - bot name: {}",
|
||||
bot->GetName());
|
||||
}
|
||||
// if (!sPlayerbotAIConfig->logInGroupOnly || bot->GetGroup()) {
|
||||
// LOG_DEBUG("playerbots", "Can cast spell failed. Mount. - bot name: {}",
|
||||
// bot->GetName());
|
||||
// }
|
||||
bot->Dismount();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "LeaveGroupAction.h"
|
||||
#include "Event.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool LeaveGroupAction::Execute(Event event)
|
||||
@@ -153,5 +154,9 @@ bool LeaveFarAwayAction::isUseful()
|
||||
if (abs(int32(master->getLevel() - bot->getLevel())) > 4)
|
||||
return true;
|
||||
|
||||
if (bot->GetMapId() != master->GetMapId() || bot->GetDistance2d(master) >= 2 * sPlayerbotAIConfig->rpgDistance) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user