[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)

This commit is contained in:
bashermens
2026-01-19 22:45:28 +01:00
committed by GitHub
parent fd07e02a8a
commit 41c53365ae
1119 changed files with 27 additions and 27 deletions

View File

@@ -0,0 +1,55 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "CombatActions.h"
#include "Event.h"
#include "LastMovementValue.h"
#include "Playerbots.h"
#include "ServerFacade.h"
bool SwitchToMeleeAction::Execute(Event event)
{
// botAI->TellMasterNoFacing("Switching to melee!");
return ChangeCombatStrategyAction::Execute(event);
}
bool SwitchToMeleeAction::isUseful()
{
if (bot->getClass() == CLASS_HUNTER)
{
Unit* target = AI_VALUE(Unit*, "current target");
time_t lastFlee = AI_VALUE(LastMovement&, "last movement").lastFlee;
return botAI->HasStrategy("ranged", BOT_STATE_COMBAT) &&
((bot->IsInCombat() && target &&
(target->GetVictim() == bot && (!bot->GetGroup() || lastFlee) &&
sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "current target"), 8.0f))) ||
(!bot->IsInCombat()));
}
return botAI->HasStrategy("ranged", BOT_STATE_COMBAT);
}
bool SwitchToRangedAction::Execute(Event event)
{
// botAI->TellMasterNoFacing("Switching to ranged!");
return ChangeCombatStrategyAction::Execute(event);
}
bool SwitchToRangedAction::isUseful()
{
if (bot->getClass() == CLASS_HUNTER)
{
Unit* target = AI_VALUE(Unit*, "current target");
bool hasAmmo = AI_VALUE2(uint32, "item count", "ammo");
return botAI->HasStrategy("close", BOT_STATE_COMBAT) && hasAmmo &&
((bot->IsInCombat() && target &&
((target->GetVictim() != bot || target->GetTarget() != bot->GetGUID()) ||
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"), 8.0f))) ||
(!bot->IsInCombat()));
}
return botAI->HasStrategy("close", BOT_STATE_COMBAT);
}