aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-08-30 22:44:03 +0100
committerNay <dnpd.dd@gmail.com>2012-08-30 22:44:03 +0100
commitabbb896cfb73017cf1c313d597984a9ce0a9dcab (patch)
tree58cd6165976448c3cdec18c4e4c6381c6bfba936 /src/server/scripts/Commands
parent5f1977cb1d690d2e60a1f5355244ec472e014278 (diff)
Core: Fix many "errors"/warnings and coding style (2)
Scripts; also reverted a change to AuthSocket Errors were found using Cppcheck, open-source static analysis tool
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();