aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-20 13:01:41 -0600
committermegamage <none@none>2008-12-20 13:01:41 -0600
commit5fd5da0123323a01731b674cc1c34410c1120d47 (patch)
treefc06b41661ac42e31b1aef45a6817d77c9246bac
parentdd7f4e92b2b20cfab4db96993203e8903104ea0c (diff)
*Do not allow player to reset instance when he is in instance.
*Fix build bug in the last commit. --HG-- branch : trunk
-rw-r--r--src/game/Creature.h2
-rw-r--r--src/game/Player.cpp3
-rw-r--r--src/game/Player.h2
-rw-r--r--src/game/Unit.h2
4 files changed, 5 insertions, 4 deletions
diff --git a/src/game/Creature.h b/src/game/Creature.h
index 6312dfbe958..7c8ad79b608 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -562,7 +562,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
CreatureSpellCooldowns m_CreatureCategoryCooldowns;
uint32 m_GlobalCooldown;
- bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance = true) const;
+ bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
bool IsWithinSightDist(Unit const* u) const;
bool canStartAttack(Unit const* u) const;
float GetAttackDistance(Unit const* pl) const;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9bbd48e1862..cbd5003e12b 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -16036,7 +16036,8 @@ void Player::ResetInstances(uint8 method)
// if the map is loaded, reset it
Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId());
if(map && map->IsDungeon())
- ((InstanceMap*)map)->Reset(method);
+ if(!((InstanceMap*)map)->Reset(method))
+ continue;
// since this is a solo instance there should not be any players inside
if(method == INSTANCE_RESET_ALL || method == INSTANCE_RESET_CHANGE_DIFFICULTY)
diff --git a/src/game/Player.h b/src/game/Player.h
index 55dda581261..9187ca3968d 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2007,7 +2007,7 @@ class TRINITY_DLL_SPEC Player : public Unit
bool HaveAtClient(WorldObject const* u) const { return u==this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); }
- bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance = true) const;
+ bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
bool IsVisibleInGridForPlayer(Player const* pl) const;
bool IsVisibleGloballyFor(Player* pl) const;
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 8771cff0688..0b5e4249df6 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1224,7 +1224,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SetVisibility(UnitVisibility x);
// common function for visibility checks for player/creatures with detection code
- virtual bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance = true) const;
+ virtual bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
bool isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
bool canDetectInvisibilityOf(Unit const* u) const;
bool canDetectStealthOf(Unit const* u, float distance) const;