Core/Game: Code style.

Signed-off-by: Gyx <[email protected]>
This commit is contained in:
Gyx
2012-03-29 13:42:04 +08:00
parent b5fb1b5b64
commit 360014856d
44 changed files with 162 additions and 139 deletions
+3 -3
View File
@@ -92,15 +92,15 @@ void GuardAI::EnterEvadeMode()
{
sLog->outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow());
}
else if (!victim ->isAlive())
else if (!victim->isAlive())
{
sLog->outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow());
}
else if (victim ->HasStealthAura())
else if (victim->HasStealthAura())
{
sLog->outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow());
}
else if (victim ->isInFlight())
else if (victim->isInFlight())
{
sLog->outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow());
}
@@ -1492,7 +1492,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!miscValue1)
{
uint32 points = 0;
for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr)
for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr)
if (AchievementEntry const* pAchievement = sAchievementStore.LookupEntry(itr->first))
points += pAchievement->points;
SetCriteriaProgress(achievementCriteria, points, PROGRESS_SET);
@@ -2039,7 +2039,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
return;
SendAchievementEarned(achievement);
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
ca.date = time(NULL);
ca.changed = true;
@@ -2070,7 +2070,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
// mail
if (reward->sender)
{
Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer ()) : NULL;
Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : NULL;
int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex();
+6 -6
View File
@@ -721,7 +721,7 @@ int32 ArenaTeam::LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int3
void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
// Called for each participant of a match after losing
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
if (itr->Guid == player->GetGUID())
{
@@ -747,7 +747,7 @@ void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32
void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
// Called for offline player after ending rated arena match!
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
if (itr->Guid == guid)
{
@@ -769,7 +769,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, i
void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
// called for each participant after winning a match
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
if (itr->Guid == player->GetGUID())
{
@@ -804,7 +804,7 @@ void ArenaTeam::UpdateArenaPointsHelper(std::map<uint32, uint32>& playerPoints)
// To get points, a player has to participate in at least 30% of the matches
uint32 requiredGames = (uint32)ceil(Stats.WeekGames * 0.3f);
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
// The player participated in enough games, update his points
uint32 pointsToAdd = 0;
@@ -840,7 +840,7 @@ void ArenaTeam::SaveToDB()
stmt->setUInt32(6, GetId());
trans->Append(stmt);
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_MEMBER);
stmt->setUInt16(0, itr->PersonalRating);
@@ -869,7 +869,7 @@ void ArenaTeam::FinishWeek()
Stats.WeekWins = 0;
// Reset member stats
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
itr->WeekGames = 0;
itr->WeekWins = 0;
@@ -65,7 +65,7 @@ namespace Trinity
private:
void do_helper(WorldPacket& data, char const* text)
{
uint64 target_guid = _source ? _source ->GetGUID() : 0;
uint64 target_guid = _source ? _source->GetGUID() : 0;
data << uint8 (_msgtype);
data << uint32(LANG_UNIVERSAL);
@@ -129,7 +129,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 de
// add group or player (grp == NULL) to bg queue with the given leader and bg specifications
GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid)
{
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
// create new ginfo
GroupQueueInfo* ginfo = new GroupQueueInfo;
@@ -184,7 +184,8 @@ enum BG_AB_Objectives
#define AB_EVENT_START_BATTLE 9158 // Achievement: Let's Get This Done
// x, y, z, o
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] =
{
{1166.785f, 1200.132f, -56.70859f, 0.9075713f}, // stables
{977.0156f, 1046.616f, -44.80923f, -2.600541f}, // blacksmith
{806.1821f, 874.2723f, -55.99371f, -2.303835f}, // farm
@@ -193,7 +194,8 @@ const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
};
// x, y, z, o, rot0, rot1, rot2, rot3
const float BG_AB_DoorPositions[2][8] = {
const float BG_AB_DoorPositions[2][8] =
{
{1284.597f, 1281.167f, -15.97792f, 0.7068594f, 0.012957f, -0.060288f, 0.344959f, 0.93659f},
{708.0903f, 708.4479f, -17.8342f, -2.391099f, 0.050291f, 0.015127f, 0.929217f, -0.365784f}
};
@@ -206,7 +208,8 @@ const uint32 BG_AB_TickPoints[6] = {0, 10, 10, 10, 10, 30};
const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT] = {895, 894, 893, 897, 896, 898, 899};
// x, y, z, o
const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] =
{
{1185.71f, 1185.24f, -56.36f, 2.56f}, // stables
{990.75f, 1008.18f, -42.60f, 2.43f}, // blacksmith
{817.66f, 843.34f, -56.54f, 3.01f}, // farm
@@ -215,7 +218,8 @@ const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
};
// x, y, z, o
const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4] = {
const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4] =
{
{1200.03f, 1171.09f, -56.47f, 5.15f}, // stables
{1017.43f, 960.61f, -42.95f, 4.88f}, // blacksmith
{833.00f, 793.00f, -57.25f, 5.27f}, // farm
@@ -356,7 +356,9 @@ enum BG_AV_OBJECTS
AV_OPLACE_MAX = 149
};
const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = {
const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] =
{
{638.592f, -32.422f, 46.0608f, -1.62316f }, //firstaid station
{669.007f, -294.078f, 30.2909f, 2.77507f }, //stormpike
{77.8013f, -404.7f, 46.7549f, -0.872665f }, //stone grave
@@ -527,7 +529,8 @@ const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = {
{-951.394f, -193.695f, 67.634f, 0.802851f}
};
const float BG_AV_DoorPositons[2][4] = {
const float BG_AV_DoorPositons[2][4] =
{
{780.487f, -493.024f, 99.9553f, 3.0976f}, //alliance
{-1375.193f, -538.981f, 55.2824f, 0.72178f} //horde
};
@@ -623,7 +626,8 @@ enum BG_AV_CreaturePlace
};
//x, y, z, o
const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = {
const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] =
{
//spiritguides
{643.000000f, 44.000000f, 69.740196f, -0.001854f},
{676.000000f, -374.000000f, 30.000000f, -0.001854f},
@@ -1039,7 +1043,8 @@ enum BG_AV_CreatureIds
//entry, team, minlevel, maxlevel
//TODO this array should be removed, the only needed things are the entrys (for spawning(?) and handlekillunit)
const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = {
const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] =
{
{ 12050, 1216, 58, 58 }, //Stormpike Defender
{ 13326, 1216, 59, 59 }, //Seasoned Defender
{ 13331, 1216, 60, 60 }, //Veteran Defender
@@ -1099,7 +1104,9 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = {
};
//x, y, z, o, static_creature_info-id
const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatures
const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] =
{
//static creatures
{-1235.31f, -340.777f, 60.5088f, 3.31613f, 0 }, //2225 - Zora Guthrek
{-1244.02f, -323.795f, 61.0485f, 5.21853f, 1 }, //3343 - Grelkor
{-1235.16f, -332.302f, 60.2985f, 2.96706f, 2 }, //3625 - Rarck
@@ -1226,7 +1233,8 @@ const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatur
};
const uint32 BG_AV_StaticCreatureInfo[51][4] = {
const uint32 BG_AV_StaticCreatureInfo[51][4] =
{
{ 2225, 1215, 55, 55 }, //Zora Guthrek
{ 3343, 1215, 55, 55 }, //Grelkor
{ 3625, 1215, 55, 55 }, //Rarck
@@ -1293,16 +1301,17 @@ enum BG_AV_Graveyards
AV_GRAVE_MAIN_HORDE = 610
};
const uint32 BG_AV_GraveyardIds[9]= {
AV_GRAVE_STORM_AID,
AV_GRAVE_STORM_GRAVE,
AV_GRAVE_STONE_GRAVE,
AV_GRAVE_SNOWFALL,
AV_GRAVE_ICE_GRAVE,
AV_GRAVE_FROSTWOLF,
AV_GRAVE_FROST_HUT,
AV_GRAVE_MAIN_ALLIANCE,
AV_GRAVE_MAIN_HORDE
const uint32 BG_AV_GraveyardIds[9]=
{
AV_GRAVE_STORM_AID,
AV_GRAVE_STORM_GRAVE,
AV_GRAVE_STONE_GRAVE,
AV_GRAVE_SNOWFALL,
AV_GRAVE_ICE_GRAVE,
AV_GRAVE_FROSTWOLF,
AV_GRAVE_FROST_HUT,
AV_GRAVE_MAIN_ALLIANCE,
AV_GRAVE_MAIN_HORDE
};
enum BG_AV_BUFF
@@ -1434,13 +1443,15 @@ enum BG_AV_WorldStates
};
//alliance_control neutral_control horde_control
const uint32 BG_AV_MineWorldStates[2][3] = {
const uint32 BG_AV_MineWorldStates[2][3] =
{
{1358, 1360, 1359},
{1355, 1357, 1356}
};
//alliance_control alliance_assault h_control h_assault
const uint32 BG_AV_NodeWorldStates[16][4] = {
const uint32 BG_AV_NodeWorldStates[16][4] =
{
//Stormpike first aid station
{1325, 1326, 1327, 1328},
//Stormpike Graveyard
@@ -29,7 +29,8 @@
#include "Util.h"
// these variables aren't used outside of this file, so declare them only here
uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = {
uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] =
{
260, // normal honor
160 // holiday
};
@@ -258,7 +258,8 @@ struct BattlegroundEYPointIconsStruct
};
// x, y, z, o
const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] = {
const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] =
{
{2044.28f, 1729.68f, 1189.96f, 0.017453f}, // FEL_REAVER center
{2048.83f, 1393.65f, 1194.49f, 0.20944f}, // BLOOD_ELF center
{2286.56f, 1402.36f, 1197.11f, 3.72381f}, // DRAENEI_RUINS center
@@ -326,7 +327,7 @@ const BattlegroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] =
class BattlegroundEYScore : public BattlegroundScore
{
public:
BattlegroundEYScore () : FlagCaptures(0) {};
BattlegroundEYScore() : FlagCaptures(0) {};
virtual ~BattlegroundEYScore() {};
uint32 FlagCaptures;
};
@@ -47,7 +47,7 @@ BattlegroundIC::BattlegroundIC()
resourceTimer = IC_RESOURCE_TIME;
for (uint8 i = NODE_TYPE_REFINERY; i < MAX_NODE_TYPES; i++)
nodePoint[i] = nodePointInitial[i];
nodePoint[i] = nodePointInitial[i];
siegeEngineWorkshopTimer = WORKSHOP_UPDATE_TIME;
@@ -926,7 +926,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
float x = t->m_WayPoints[0].x;
float y = t->m_WayPoints[0].y;
float z = t->m_WayPoints[0].z;
float z = t->m_WayPoints[0].z;
float o = 1;
// creates the Gameobject
@@ -37,7 +37,8 @@ enum BG_WSG_Rewards
BG_WSG_REWARD_NUM
};
uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = {
uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] =
{
{20, 40, 40}, // normal honor
{60, 40, 80} // holiday
};
+4 -4
View File
@@ -488,7 +488,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
continue;
name = areaEntry->area_name[loc];
if (name.empty ())
if (name.empty())
continue;
if (Utf8FitTo (name, wnamepart))
@@ -511,7 +511,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
else
ss << areaEntry->ID << " - " << name << ' ' << localeNames[loc];
SendSysMessage (ss.str ().c_str());
SendSysMessage(ss.str().c_str());
if (!found)
found = true;
@@ -520,7 +520,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
}
if (!found)
SendSysMessage (LANG_COMMAND_NOAREAFOUND);
SendSysMessage(LANG_COMMAND_NOAREAFOUND);
return true;
}
@@ -693,7 +693,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
}
Map* gmMap = m_session->GetPlayer()->GetMap();
bool to_instance = gmMap->Instanceable();
bool to_instance = gmMap->Instanceable();
// we are in instance, and can summon only player in our group with us as lead
if (to_instance && (
+24 -25
View File
@@ -100,7 +100,7 @@ bool ChatHandler::HandleSetSkillCommand(const char *args)
return false;
}
int32 level = atol (level_p);
int32 level = atol(level_p);
Player* target = getSelectedPlayer();
if (!target)
@@ -1239,7 +1239,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
uint8 localeIndex = GetSessionDbLocaleIndex();
if (CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(id))
{
if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ())
if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty())
{
std::string name = cl->Name[localeIndex];
@@ -1252,9 +1252,9 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
}
if (m_session)
PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ());
PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
else
PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ());
PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
if (!found)
found = true;
@@ -1265,7 +1265,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
}
std::string name = itr->second.Name;
if (name.empty ())
if (name.empty())
continue;
if (Utf8FitTo(name, wnamepart))
@@ -1277,9 +1277,9 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
}
if (m_session)
PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ());
PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
else
PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ());
PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
if (!found)
found = true;
@@ -1287,7 +1287,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
}
if (!found)
SendSysMessage (LANG_COMMAND_NOCREATUREFOUND);
SendSysMessage(LANG_COMMAND_NOCREATUREFOUND);
return true;
}
@@ -1375,7 +1375,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args)
return false;
// Can be NULL at console call
Player* target = getSelectedPlayer ();
Player* target = getSelectedPlayer();
std::string namepart = args;
std::wstring wnamepart;
@@ -1527,10 +1527,10 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
// send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
if (m_session)
PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc],
PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc],
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
else
PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc],
PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc],
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
if (!found)
@@ -1679,16 +1679,16 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args)
if (target->GetGuildId())
{
SendSysMessage (LANG_PLAYER_IN_GUILD);
SendSysMessage(LANG_PLAYER_IN_GUILD);
return true;
}
Guild* guild = new Guild;
if (!guild->Create (target, guildname))
if (!guild->Create(target, guildname))
{
delete guild;
SendSysMessage (LANG_GUILD_NOT_CREATED);
SetSentErrorMessage (true);
SendSysMessage(LANG_GUILD_NOT_CREATED);
SetSentErrorMessage(true);
return false;
}
@@ -1715,7 +1715,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
return false;
std::string glName = guildStr;
Guild* targetGuild = sGuildMgr->GetGuildByName (glName);
Guild* targetGuild = sGuildMgr->GetGuildByName(glName);
if (!targetGuild)
return false;
@@ -1730,12 +1730,11 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
if (!extractPlayerTarget((char*)args, &target, &target_guid))
return false;
uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid);
uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(target_guid);
if (!glId)
return false;
Guild* targetGuild = sGuildMgr->GetGuildById (glId);
Guild* targetGuild = sGuildMgr->GetGuildById(glId);
if (!targetGuild)
return false;
@@ -1757,7 +1756,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
return false;
uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid);
uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(target_guid);
if (!glId)
return false;
@@ -1780,11 +1779,11 @@ bool ChatHandler::HandleGuildDeleteCommand(const char *args)
std::string gld = guildStr;
Guild* targetGuild = sGuildMgr->GetGuildByName (gld);
Guild* targetGuild = sGuildMgr->GetGuildByName(gld);
if (!targetGuild)
return false;
targetGuild->Disband ();
targetGuild->Disband();
return true;
}
@@ -2025,7 +2024,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args)
else
return false;
WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id);
WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id);
if (!graveyard)
{
@@ -3365,7 +3364,7 @@ bool ChatHandler::HandleBanListHelper(PreparedQueryResult result)
{
SendSysMessage("-------------------------------------------------------------------------------");
Field* fields = result->Fetch();
uint32 account_id = fields[0].GetUInt32 ();
uint32 account_id = fields[0].GetUInt32();
std::string account_name;
@@ -4464,7 +4463,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
if (!*args)
return false;
char *channel = strtok((char*)args, " ");
char *argstr = strtok(NULL, "");
char *argstr = strtok(NULL, "");
if (!channel || !argstr)
return false;
+1 -1
View File
@@ -536,7 +536,7 @@ void LoadDBCStores(const std::string& dataPath)
// include existed nodes that have at least single not spell base (scripted) path
{
std::set<uint32> spellPaths;
for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
if (SpellEntry const* sInfo = sSpellStore.LookupEntry (i))
for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI)
+9 -9
View File
@@ -765,7 +765,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
return false;
if (owner->GetLootGUID() == GetGUID())
return false;
@@ -791,16 +791,16 @@ bool Item::HasEnchantRequiredSkill(const Player* player) const
uint32 Item::GetEnchantRequiredLevel() const
{
uint32 level = 0;
uint32 level = 0;
// Check all enchants for required level
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->requiredLevel > level)
level = enchantEntry->requiredLevel;
// Check all enchants for required level
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->requiredLevel > level)
level = enchantEntry->requiredLevel;
return level;
return level;
}
bool Item::IsBoundByEnchant() const
+1 -1
View File
@@ -211,7 +211,7 @@ class Item : public Object
static Item* CreateItem(uint32 item, uint32 count, Player const* player = NULL);
Item* CloneItem(uint32 count, Player const* player = NULL) const;
Item ();
Item();
virtual bool Create(uint32 guidlow, uint32 itemid, Player const* owner);
@@ -107,7 +107,7 @@ uint32 GetItemEnchantMod(int32 entry)
}
//we could get here only if sum of all enchantment chances is lower than 100%
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
fCount = 0;
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
+1 -1
View File
@@ -1510,7 +1510,7 @@ bool Position::HasInArc(float arc, const Position* obj) const
if (angle > M_PI)
angle -= 2.0f*M_PI;
float lborder = -1 * (arc/2.0f); // in range -pi..0
float lborder = -1 * (arc/2.0f); // in range -pi..0
float rborder = (arc/2.0f); // in range 0..pi
return ((angle >= lborder) && (angle <= rborder));
}
+2 -2
View File
@@ -122,7 +122,7 @@ typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
class Object
{
public:
virtual ~Object ();
virtual ~Object();
bool IsInWorld() const { return m_inWorld; }
@@ -315,7 +315,7 @@ class Object
Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; }
protected:
Object ();
Object();
void _InitValues();
void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh);
@@ -133,7 +133,7 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle)
if (m_smallStepOk[USED_POS_MINUS])
ok = NextSmallStepAngle(-1.0f, USED_POS_MINUS, angle);
else
ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle);
ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle);
if (!ok)
++m_nextUsedPos[USED_POS_MINUS];
+14 -13
View File
@@ -865,7 +865,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
SetPendingBind(0, 0);
}
Player::~Player ()
Player::~Player()
{
// it must be unloaded already in PlayerLogout and accessed only for loggined player
//m_social = NULL;
@@ -885,7 +885,7 @@ Player::~Player ()
}
//all mailed items should be deleted, also all mail should be deallocated
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
delete *itr;
for (ItemMap::iterator iter = mMitems.begin(); iter != mMitems.end(); ++iter)
@@ -3145,7 +3145,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
// reset before any aura state sources (health set/aura apply)
SetUInt32Value(UNIT_FIELD_AURASTATE, 0);
UpdateSkillsForLevel ();
UpdateSkillsForLevel();
// set default cast time multiplier
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
@@ -3424,7 +3424,7 @@ void Player::AddNewMailDeliverTime(time_t deliver_time)
else // not ready and no have ready mails
{
if (!m_nextMailDelivereTime || m_nextMailDelivereTime > deliver_time)
m_nextMailDelivereTime = deliver_time;
m_nextMailDelivereTime = deliver_time;
}
}
@@ -3799,7 +3799,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
uint32 new_skill_max_value = spellLearnSkill->maxvalue == 0 ? maxskill : spellLearnSkill->maxvalue;
if (skill_max_value < new_skill_max_value)
skill_max_value = new_skill_max_value;
skill_max_value = new_skill_max_value;
SetSkill(spellLearnSkill->skill, spellLearnSkill->step, skill_value, skill_max_value);
}
@@ -5363,7 +5363,7 @@ void Player::CreateCorpse()
iDisplayID = m_items[i]->GetTemplate()->DisplayInfoID;
iIventoryType = m_items[i]->GetTemplate()->InventoryType;
_cfi = iDisplayID | (iIventoryType << 24);
_cfi = iDisplayID | (iIventoryType << 24);
corpse->SetUInt32Value(CORPSE_FIELD_ITEM + i, _cfi);
}
}
@@ -5419,7 +5419,7 @@ void Player::DurabilityLoss(Item* item, double percent)
if (!item)
return;
uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
if (!pMaxDurability)
return;
@@ -6663,7 +6663,7 @@ uint16 Player::GetBaseSkillValue(uint32 skill) const
return 0;
int32 result = int32(SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos))));
result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos)));
result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos)));
return result < 0 ? 0 : result;
}
@@ -8454,7 +8454,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id);
SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id);
if (entry && entry->procEx)
{
@@ -8829,7 +8829,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
if (go->getLootState() == GO_READY)
{
uint32 lootid = go->GetGOInfo()->GetLootId();
uint32 lootid = go->GetGOInfo()->GetLootId();
//TODO: fix this big hack
if ((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S))
@@ -11652,8 +11652,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
ItemPosCountVec off_dest;
if (offItem && (!not_loading ||
CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK ||
CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK))
CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK ||
CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK))
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL;
}
}
@@ -23799,7 +23799,8 @@ void Player::AddRunePower(uint8 index)
GetSession()->SendPacket(&data);
}
static RuneType runeSlotTypes[MAX_RUNES] = {
static RuneType runeSlotTypes[MAX_RUNES] =
{
/*0*/ RUNE_BLOOD,
/*1*/ RUNE_BLOOD,
/*2*/ RUNE_UNHOLY,
+1 -1
View File
@@ -1064,7 +1064,7 @@ class Player : public Unit, public GridObject<Player>
friend void Item::RemoveFromUpdateQueueOf(Player* player);
public:
explicit Player (WorldSession* session);
~Player ();
~Player();
void CleanupsBeforeDelete(bool finalCleanup = true);
+1 -1
View File
@@ -398,7 +398,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
break;
}
case CLASS_MAGE:
val2 = GetStat(STAT_STRENGTH) - 10.0f;
val2 = GetStat(STAT_STRENGTH) - 10.0f;
break;
case CLASS_PRIEST:
val2 = GetStat(STAT_STRENGTH) - 10.0f;
+4 -2
View File
@@ -71,7 +71,9 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
4.5f, // MOVE_FLIGHT_BACK
3.14f // MOVE_PITCH_RATE
};
float playerBaseMoveSpeed[MAX_MOVE_TYPE] = {
float playerBaseMoveSpeed[MAX_MOVE_TYPE] =
{
2.5f, // MOVE_WALK
7.0f, // MOVE_RUN
4.5f, // MOVE_RUN_BACK
@@ -667,7 +669,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
duel_hasEnded = true;
}
else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER)
else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER)
{
Player* victimRider = victim->GetCharmer()->ToPlayer();
+1 -1
View File
@@ -1236,7 +1236,7 @@ class Unit : public WorldObject
typedef std::map<uint8, AuraApplication*> VisibleAuraMap;
virtual ~Unit ();
virtual ~Unit();
UnitAI* GetAI() { return i_AI; }
void SetAI(UnitAI* newAI) { i_AI = newAI; }
+3 -3
View File
@@ -1131,7 +1131,7 @@ void ObjectMgr::LoadCreatureModelInfo()
uint32 modelId = fields[0].GetUInt32();
CreatureModelInfo& modelInfo = _creatureModelStore[modelId];
CreatureModelInfo& modelInfo = _creatureModelStore[modelId];
modelInfo.bounding_radius = fields[1].GetFloat();
modelInfo.combat_reach = fields[2].GetFloat();
@@ -2946,7 +2946,7 @@ void ObjectMgr::LoadPetLevelInfo()
PetLevelInfo*& pInfoMapEntry = _petInfoStore[creature_id];
if (pInfoMapEntry == NULL)
pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
// data for level 1 stored in [0] array element, ...
PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1];
@@ -4991,7 +4991,7 @@ void ObjectMgr::LoadPageTexts()
{
Field* fields = result->Fetch();
PageText& pageText = _pageTextStore[fields[0].GetUInt32()];
PageText& pageText = _pageTextStore[fields[0].GetUInt32()];
pageText.Text = fields[1].GetString();
pageText.NextPage = fields[2].GetUInt32();
+1 -1
View File
@@ -558,7 +558,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
//load players mails, and mailed items
if (!player->m_mailsLoaded)
player ->_LoadMail();
player->_LoadMail();
// client can't work with packets > max int16 value
const uint32 maxPacketSize = 32767;
+1 -1
View File
@@ -412,7 +412,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
trader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT);
// test if item will fit in each inventory
hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK);
hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK);
myCanCompleteTrade = (_player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK);
clearAcceptTradeMode(myItems, hisItems);
+4 -3
View File
@@ -26,7 +26,8 @@
#include "SpellInfo.h"
#include "Group.h"
static Rates const qualityToRate[MAX_ITEM_QUALITY] = {
static Rates const qualityToRate[MAX_ITEM_QUALITY] =
{
RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR
RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL
RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON
@@ -761,7 +762,7 @@ bool Loot::hasItemFor(Player* player) const
QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow());
if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
QuestItemList* conditional_list = nn_itr->second;
QuestItemList* conditional_list = nn_itr->second;
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
{
const LootItem &item = items[ci->index];
@@ -937,7 +938,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUIDLow());
if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
QuestItemList* conditional_list = nn_itr->second;
QuestItemList* conditional_list = nn_itr->second;
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
{
LootItem &item = l.items[ci->index];
+1 -1
View File
@@ -52,7 +52,7 @@ class MapUpdateRequest : public ACE_Method_Request
virtual int call()
{
m_map.Update (m_diff);
m_updater.update_finished ();
m_updater.update_finished();
return 0;
}
};
@@ -248,7 +248,8 @@ enum SpellCategory
SPELL_CATEGORY_DRINK = 59,
};
const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
const uint32 ItemQualityColors[MAX_ITEM_QUALITY] =
{
0xff9d9d9d, //GREY
0xffffffff, //WHITE
0xff1eff00, //GREEN
@@ -66,7 +66,7 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
}
unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z);
i_waypoints[idx][2] = z;
i_waypoints[idx][2] = z;
}
unit.StopMoving();
+1 -1
View File
@@ -566,7 +566,7 @@ void Map::ScriptsProcess()
step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
}
worldObject = dynamic_cast<WorldObject*>(target);
worldObject = dynamic_cast<WorldObject*>(target);
}
else
{
+4 -4
View File
@@ -121,8 +121,8 @@ WorldSession::~WorldSession()
/// - If have unclosed socket, close it
if (m_Socket)
{
m_Socket->CloseSocket ();
m_Socket->RemoveReference ();
m_Socket->CloseSocket();
m_Socket->RemoveReference();
m_Socket = NULL;
}
@@ -196,7 +196,7 @@ void WorldSession::SendPacket(WorldPacket const* packet)
#endif // !TRINITY_DEBUG
if (m_Socket->SendPacket (*packet) == -1)
m_Socket->CloseSocket ();
m_Socket->CloseSocket();
}
/// Add an incoming packet to the queue
@@ -527,7 +527,7 @@ void WorldSession::LogoutPlayer(bool Save)
///- Broadcast a logout message to the player's friends
sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
sSocialMgr->RemovePlayerSocial (_player->GetGUIDLow ());
sSocialMgr->RemovePlayerSocial(_player->GetGUIDLow());
// Call script hook before deletion
sScriptMgr->OnPlayerLogout(GetPlayer());
@@ -3481,7 +3481,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
{
bool banishFound = false;
Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
{
banishFound = true;
@@ -4594,7 +4594,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod
flag96 mask;
Unit::AuraEffectList const& noReagent = target->GetAuraEffectsByType(SPELL_AURA_NO_REAGENT_USE);
for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask;
target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]);
@@ -5189,7 +5189,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true);
}
else
target-> RemoveAurasDueToSpell(50322);
target->RemoveAurasDueToSpell(50322);
break;
}
}
@@ -6173,7 +6173,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
uint32 absorb = 0;
uint32 resist = 0;
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
// ignore non positive values (can be result apply spellmods to aura damage
uint32 damage = std::max(GetAmount(), 0);
@@ -6466,7 +6466,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb);
caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false);
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
caster->DealDamage(caster, funnelDamage, &cleanDamage, NODAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
}
+1 -1
View File
@@ -453,7 +453,7 @@ void Aura::_Remove(AuraRemoveMode removeMode)
ApplicationMap::iterator appItr = m_applications.begin();
for (appItr = m_applications.begin(); appItr != m_applications.end();)
{
AuraApplication * aurApp = appItr->second;
AuraApplication * aurApp = appItr->second;
Unit* target = aurApp->GetTarget();
target->_UnapplyAura(aurApp, removeMode);
appItr = m_applications.begin();
+1 -1
View File
@@ -2166,7 +2166,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
if (targetInfo.missCondition == SPELL_MISS_REFLECT)
{
// Calculate reflected spell result on caster
targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect);
targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect);
if (targetInfo.reflectResult == SPELL_MISS_REFLECT) // Impossible reflect again, so simply deflect spell
targetInfo.reflectResult = SPELL_MISS_PARRY;
+4 -3
View File
@@ -2761,7 +2761,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex)
if (damage < 0)
return;
uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue;
uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue;
uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid);
unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), skillval?skillval:1, damage*75);
}
@@ -4630,7 +4630,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
45684 // Polymorph
};
static uint32 const spellTarget[5] = {
static uint32 const spellTarget[5] =
{
45673, // Bigger!
45672, // Shrunk
45677, // Yellow
@@ -5079,7 +5080,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex)
return;
// must be equipped
if (!item ->IsEquipped())
if (!item->IsEquipped())
return;
if (m_spellInfo->Effects[effIndex].MiscValue)
+3 -3
View File
@@ -1277,7 +1277,7 @@ void SpellMgr::LoadSpellRequired()
{
Field* fields = result->Fetch();
uint32 spell_id = fields[0].GetUInt32();
uint32 spell_id = fields[0].GetUInt32();
uint32 spell_req = fields[1].GetUInt32();
// check if chain is made with valid first spell
@@ -2181,8 +2181,8 @@ void SpellMgr::LoadSpellLinked()
Field* fields = result->Fetch();
int32 trigger = fields[0].GetInt32();
int32 effect = fields[1].GetInt32();
int32 type = fields[2].GetUInt8();
int32 effect = fields[1].GetInt32();
int32 type = fields[2].GetUInt8();
SpellInfo const* spellInfo = GetSpellInfo(abs(trigger));
if (!spellInfo)
+1 -1
View File
@@ -147,7 +147,7 @@ bool Weather::ReGenerate()
}
// At this point, only weather that isn't doing anything remains but that have weather data
uint32 chance1 = m_weatherChances->data[season].rainChance;
uint32 chance1 = m_weatherChances->data[season].rainChance;
uint32 chance2 = chance1+ m_weatherChances->data[season].snowChance;
uint32 chance3 = chance2+ m_weatherChances->data[season].stormChance;