Skip to content

Commit c16e339

Browse files
killerwiferobinsch
andcommitted
GameObject: Add a couple more checks to CanUseNow
Co-Authored-By: robinsch <robinsch@users.noreply.github.com>
1 parent d537671 commit c16e339

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/game/Entities/GameObject.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,20 +1514,17 @@ bool GameObject::CanUseNow(Player const* player) const
15141514

15151515
if (!GetGOInfo()->GetLockId())
15161516
{
1517-
// ignore for remote control state
1518-
if (!player->IsSelfMover())
1519-
{
1520-
// check player on vehicle
1521-
if (!player->GetTransportInfo() || !player->GetTransportInfo()->IsOnVehicle() || !GetGOInfo()->IsUsableMounted())
1522-
return false;
1523-
}
1517+
// mounted and cannot unmount
1518+
if (player->GetMountID() && !GetGOInfo()->IsUsableMounted() && (player->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT) || !player->IsClientControlled()))
1519+
return false;
15241520

15251521
// We can't interact with anyone while being shapeshifted, unless form flags allow us to do so
15261522
if (player->IsShapeShifted())
15271523
{
15281524
if (SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(player->GetShapeshiftForm()))
15291525
{
1530-
if (!(formEntry->flags1 & SHAPESHIFT_FLAG_CAN_NPC_INTERACT) && player->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT)) // meant to have an can unshift check here
1526+
// meant to have an can unshift check here
1527+
if (!(formEntry->flags1 & SHAPESHIFT_FLAG_CAN_NPC_INTERACT) && (player->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT) || !player->IsClientControlled() || (formEntry->flags1 & SHAPESHIFT_FLAG_DONT_AUTO_UNSHIFT) != 0))
15311528
return false;
15321529
}
15331530
else

0 commit comments

Comments
 (0)