aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Player/Player.cpp6
-rw-r--r--src/server/game/World/World.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp22
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp12
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp24
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp2
6 files changed, 15 insertions, 53 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b1abf028262..3c09f9983ac 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -4702,12 +4702,6 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
charDelete_method = CHAR_DELETE_REMOVE;
else if (CharacterNameData const* nameData = sWorld->GetCharacterNameData(guid)) // To avoid a query, we select loaded data. If it doesn't exist, return.
{
- if (!nameData)
- {
- TC_LOG_ERROR(LOG_FILTER_PLAYER, "Cannot find CharacterNameData entry for player %u from account %u. Could not delete character.", guid, accountId);
- return;
- }
-
// Define the required variables
uint32 charDelete_minLvl = sWorld->getIntConfig(nameData->m_class != CLASS_DEATH_KNIGHT ? CONFIG_CHARDELETE_MIN_LEVEL : CONFIG_CHARDELETE_HEROIC_MIN_LEVEL);
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 870f749aa07..80577c3462e 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -2167,7 +2167,7 @@ namespace Trinity
{
WorldPacket* data = new WorldPacket();
- uint32 lineLength = (line ? strlen(line) : 0) + 1;
+ uint32 lineLength = strlen(line) + 1;
data->Initialize(SMSG_MESSAGECHAT, 100); // guess size
*data << uint8(CHAT_MSG_SYSTEM);
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 2130e61cb47..b014eb895be 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -962,12 +962,7 @@ public:
uint32 id = atoi((char*)args);
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = 1;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
- if (spellInfo)
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id))
{
int locale = handler->GetSessionDbcLocale();
std::string name = spellInfo->SpellName[locale];
@@ -977,14 +972,6 @@ public:
return true;
}
- if (locale < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
bool known = target && target->HasSpell(id);
bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
@@ -1028,13 +1015,8 @@ public:
ss << handler->GetTrinityString(LANG_ACTIVE);
handler->SendSysMessage(ss.str().c_str());
-
- if (!found)
- found = true;
- }
}
-
- if (!found)
+ else
handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
return true;
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index cadaeff5262..5e4acbb2ba5 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1071,9 +1071,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
uint32 zone_id = player->GetZoneId();
- WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
- player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team);
-
+ WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team);
if (graveyard)
{
uint32 graveyardId = graveyard->ID;
@@ -1103,14 +1101,12 @@ public:
{
std::string team_name;
- if (team == 0)
- team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
- else if (team == HORDE)
+ if (team == HORDE)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
else if (team == ALLIANCE)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
- if (team == ~uint32(0))
+ if (!team)
handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
else
handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str());
@@ -2144,7 +2140,7 @@ public:
return true;
}
- uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL;
+ uint32 school = atoi((char*)schoolStr);
if (school >= MAX_SPELL_SCHOOL)
return false;
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 8ef88d459e2..ff4ef587fad 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -309,24 +309,14 @@ public:
if (!pfactionid)
{
- if (target)
- {
- uint32 factionid = target->getFaction();
- uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
- uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
- uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
- handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUIDLow(), factionid, flag, npcflag, dyflag);
- }
+ uint32 factionid = target->getFaction();
+ uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
+ uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
+ uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
+ handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUIDLow(), factionid, flag, npcflag, dyflag);
return true;
}
- if (!target)
- {
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
uint32 factionid = atoi(pfactionid);
uint32 flag;
@@ -340,7 +330,7 @@ public:
uint32 npcflag;
if (!pnpcflag)
- npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
+ npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
else
npcflag = atoi(pnpcflag);
@@ -348,7 +338,7 @@ public:
uint32 dyflag;
if (!pdyflag)
- dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
+ dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
else
dyflag = atoi(pdyflag);
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index ea387ef17be..43c9b294419 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -252,7 +252,7 @@ public:
return false;
}
- uint32 vendor_entry = vendor ? vendor->GetEntry() : 0;
+ uint32 vendor_entry = vendor->GetEntry();
if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, handler->GetSession()->GetPlayer()))
{