diff options
| author | ille <ille@ille> | 2012-01-08 18:22:46 +0100 |
|---|---|---|
| committer | ille <ille@ille> | 2012-01-08 18:22:46 +0100 |
| commit | baa2252bd31718e93ccc3e97aa81afeecb5ec9c3 (patch) | |
| tree | 3117fb09caedd90caccee68f9c149a527ba25f61 /src/server/game/Entities/Object | |
| parent | b5a53a72d1e52a25ab5aac429e9d9f793c4df5ba (diff) | |
implement objectdetection
Diffstat (limited to 'src/server/game/Entities/Object')
| -rwxr-xr-x | src/server/game/Entities/Object/Object.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2fc4d8493f4..68057d7148a 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1796,11 +1796,15 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj) const // Level difference: 5 point / level, starting from level 1. // There may be spells for this and the starting points too, but - // not in the DBCs of the client. + // not in the DBCs of the client. detectionValue += int32(getLevelForTarget(obj) - 1) * 5; // Apply modifiers detectionValue += m_stealthDetect.GetValue(StealthType(i)); + if (obj->isType(TYPEMASK_GAMEOBJECT)) + if (Unit* owner = ((GameObject*)obj)->GetOwner()) + detectionValue -= int32(owner->getLevelForTarget(this) - 1) * 5; + detectionValue -= obj->m_stealth.GetValue(StealthType(i)); // Calculate max distance |
