mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[6977] Fixed a crash caused by incorrect use of GetMap for corpses in other maps, and another one caused by SelectHostilTarget failing to notice the target is not in world, due to a fauly InSameMap check.
This commit is contained in:
parent
75b1db8cd0
commit
07394d45da
3 changed files with 3 additions and 3 deletions
|
|
@ -416,7 +416,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
|||
float GetDistance2d(const WorldObject* obj) const;
|
||||
float GetDistance2d(const float x, const float y) const;
|
||||
float GetDistanceZ(const WorldObject* obj) const;
|
||||
bool IsInMap(const WorldObject* obj) const { return GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
|
||||
bool IsInMap(const WorldObject* obj) const { return IsInWorld() && obj->IsInWorld() && GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
|
||||
bool IsWithinDistInMap(const WorldObject* obj, const float dist2compare, const bool is3D = true) const;
|
||||
bool IsWithinLOS(const float x, const float y, const float z ) const;
|
||||
bool IsWithinLOSInMap(const WorldObject* obj) const;
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
|||
float z = corpse->GetPositionZ();
|
||||
int32 corpsemapid = _player->GetMapId();
|
||||
|
||||
if(Map *map = corpse->GetMap())
|
||||
if(Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()))
|
||||
{
|
||||
if(map->IsDungeon())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6976"
|
||||
#define REVISION_NR "6977"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue