mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9797] Prevent interect with NPC/Gameobject player in non-react state
* (stun,confuse,fleeing). * This also fix cheating with taxi use. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
6ab55fa09e
commit
bb95e4a868
2 changed files with 9 additions and 1 deletions
|
|
@ -2137,6 +2137,10 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
|||
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
|
||||
return NULL;
|
||||
|
||||
// not in interactive state
|
||||
if (hasUnitState(UNIT_STAT_CAN_NOT_REACT))
|
||||
return NULL;
|
||||
|
||||
// exist (we need look pets also for some interaction (quest/etc)
|
||||
Creature *unit = GetMap()->GetCreatureOrPetOrVehicle(guid);
|
||||
if (!unit)
|
||||
|
|
@ -2187,6 +2191,10 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameo
|
|||
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
|
||||
return NULL;
|
||||
|
||||
// not in interactive state
|
||||
if (hasUnitState(UNIT_STAT_CAN_NOT_REACT))
|
||||
return NULL;
|
||||
|
||||
if (GameObject *go = GetMap()->GetGameObject(guid))
|
||||
{
|
||||
if (uint32(go->GetGoType()) == gameobject_type || gameobject_type == MAX_GAMEOBJECT_TYPE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue