aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-08-30 19:16:09 -0500
committerSubv <s.v.h21@hotmail.com>2012-08-30 19:16:09 -0500
commit554e88dd63c244f740d385d8a45d4e4405e951ba (patch)
treeabcd721b4f6e7e8a9189455386a3d3b0b9eac0e4 /src/server/scripts/Commands
parent532ddfcd402390a9caf3ac5863bba2f0db9d0efc (diff)
parente3d9768a50a3b2b700d65e0cc96e697a5c9d22dc (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 99ec263b8f9..e3cd185e4a3 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -642,19 +642,13 @@ public:
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
- // wpCreature
- Creature* wpCreature = NULL;
-
if (wpGuid != 0)
- {
- wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- if (wpCreature)
+ if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
{
wpCreature->CombatStop();
wpCreature->DeleteFromDB();
wpCreature->AddObjectToRemoveList();
}
- }
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA);
@@ -681,15 +675,12 @@ public:
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
{
- // wpCreature
- Creature* wpCreature = NULL;
// What to do:
// Move the visual spawnpoint
// Respawn the owner of the waypoints
if (wpGuid != 0)
{
- wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- if (wpCreature)
+ if (Creature* wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
{
wpCreature->CombatStop();
wpCreature->DeleteFromDB();