aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-03-11 15:03:29 +0100
committerShauren <shauren.trinity@gmail.com>2012-03-11 15:03:29 +0100
commit3cf8b9a15afee5e65b368721a74b4a942c027134 (patch)
tree99e436c82296f2988ac89bd80e2fa27f71b61d09 /src
parentb1a8570a309e73b07d2b332ad6c4e30024c0787f (diff)
Scripts/Serpentshrine Cavern: Fixed crashes caused by uninitialized variables, patch by PuniCZ
Closes #4988 Closes #5645
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index 2db259744df..6de4c1c60ca 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -608,24 +608,21 @@ public:
VashjGUID = 0;
- for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs)
+ x = ElementWPPos[0][0];
+ y = ElementWPPos[0][1];
+ z = ElementWPPos[0][2];
+
+ //search for nearest waypoint (up on stairs)
+ for (uint32 i = 1; i < 8; ++i)
{
- if (!x || !y || !z)
+ if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z))
{
x = ElementWPPos[i][0];
y = ElementWPPos[i][1];
z = ElementWPPos[i][2];
}
- else
- {
- if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z))
- {
- x = ElementWPPos[i][0];
- y = ElementWPPos[i][1];
- z = ElementWPPos[i][2];
- }
- }
}
+
if (instance)
VashjGUID = instance->GetData64(DATA_LADYVASHJ);
}