[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:
Chipleo 2010-04-27 05:09:55 +04:00 committed by VladimirMangos
parent 6ab55fa09e
commit bb95e4a868
2 changed files with 9 additions and 1 deletions

View file

@ -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)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9796"
#define REVISION_NR "9797"
#endif // __REVISION_NR_H__