mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +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())
|
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
|
||||||
return NULL;
|
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)
|
// exist (we need look pets also for some interaction (quest/etc)
|
||||||
Creature *unit = GetMap()->GetCreatureOrPetOrVehicle(guid);
|
Creature *unit = GetMap()->GetCreatureOrPetOrVehicle(guid);
|
||||||
if (!unit)
|
if (!unit)
|
||||||
|
|
@ -2187,6 +2191,10 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameo
|
||||||
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
|
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
// not in interactive state
|
||||||
|
if (hasUnitState(UNIT_STAT_CAN_NOT_REACT))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (GameObject *go = GetMap()->GetGameObject(guid))
|
if (GameObject *go = GetMap()->GetGameObject(guid))
|
||||||
{
|
{
|
||||||
if (uint32(go->GetGoType()) == gameobject_type || gameobject_type == MAX_GAMEOBJECT_TYPE)
|
if (uint32(go->GetGoType()) == gameobject_type || gameobject_type == MAX_GAMEOBJECT_TYPE)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9796"
|
#define REVISION_NR "9797"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue