mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
fix(Scripts/Vehicles): The next player entering Salvaged Siege Engine… (#10987)
… should control turret if it's not occupied.
This commit is contained in:
@@ -177,6 +177,8 @@ public:
|
||||
/// == Fields =======================================
|
||||
virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {}
|
||||
|
||||
virtual bool BeforeSpellClick(Unit* /*clicker*/) { return true; }
|
||||
|
||||
virtual void OnSpellClick(Unit* /*clicker*/, bool& /*result*/) { }
|
||||
|
||||
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
|
||||
|
||||
@@ -18899,6 +18899,15 @@ void Unit::JumpTo(WorldObject* obj, float speedZ)
|
||||
|
||||
bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
{
|
||||
Creature* creature = ToCreature();
|
||||
if (creature && creature->IsAIEnabled)
|
||||
{
|
||||
if (!creature->AI()->BeforeSpellClick(clicker))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->GetCreatureEntry() : GetEntry();
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
|
||||
@@ -18967,7 +18976,6 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
result = true;
|
||||
}
|
||||
|
||||
Creature* creature = ToCreature();
|
||||
if (creature && creature->IsAIEnabled)
|
||||
creature->AI()->OnSpellClick(clicker, result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user