From b4e65a8840b37db943cbdeb2ec4f816054cea326 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Wed, 22 May 2013 19:52:48 -0700 Subject: [PATCH] tabbify and cleaned up std issues and min/max problems. --- common/EQStream.cpp | 40 ++++++++++++--------- common/Item.cpp | 31 +++++++++++++--- common/ProcLauncher.cpp | 30 +++++++++------- loginserver/Encryption.cpp | 4 ++- zone/attack.cpp | 12 +++---- zone/bot.cpp | 74 +++++++++++++++++++------------------- zone/botspellsai.cpp | 8 ++--- zone/client.h | 39 ++++++++++++-------- zone/client_mods.cpp | 10 +++--- zone/entity.h | 11 +++--- 10 files changed, 153 insertions(+), 106 deletions(-) diff --git a/common/EQStream.cpp b/common/EQStream.cpp index 1aaf39527..3f68d2d69 100644 --- a/common/EQStream.cpp +++ b/common/EQStream.cpp @@ -15,16 +15,36 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "debug.h" +#include "EQPacket.h" +#include "EQStream.h" +#include "misc.h" +#include "Mutex.h" +#include "op_codes.h" +#include "CRC16.h" + #include #include #include #include -#include -#include +#include + +#if defined(ZONE) || defined(WORLD) + #define RETRANSMITS +#endif +#ifdef RETRANSMITS + #include "rulesys.h" +#endif + #ifdef _WINDOWS #include + // have to undefine these since a macro version + // is defined in windef.h (which windows includes) + #undef min + #undef max #else + #include #include #include #include @@ -33,20 +53,6 @@ #include #include #endif -#include "EQPacket.h" -#include "EQStream.h" -//#include "EQStreamFactory.h" -#include "misc.h" -#include "Mutex.h" -#include "op_codes.h" -#include "CRC16.h" - -#if defined(ZONE) || defined(WORLD) - #define RETRANSMITS -#endif -#ifdef RETRANSMITS - #include "rulesys.h" -#endif //for logsys #define _L "%s:%d: " @@ -567,7 +573,7 @@ uint32 length; while (usedpBuffer+2,tmpbuff+used,chunksize); out->size=chunksize+2; SequencedPush(out); diff --git a/common/Item.cpp b/common/Item.cpp index 8ac1e21dc..3e798363e 100644 --- a/common/Item.cpp +++ b/common/Item.cpp @@ -16,10 +16,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include - #include "debug.h" #include "StringUtil.h" #include "Item.h" @@ -29,6 +25,11 @@ #include "shareddb.h" #include "classes.h" +#include + +#include +#include + int32 NextItemInstSerialNumber = 1; static inline int32 GetNextItemInstSerialNumber() { @@ -43,7 +44,7 @@ static inline int32 GetNextItemInstSerialNumber() { // NextItemInstSerialNumber is the next one to hand out. // // It is very unlikely to reach 2,147,483,647. Maybe we should call abort(), rather than wrapping back to 1. - if(NextItemInstSerialNumber >= std::numeric_limits::max()) + if(NextItemInstSerialNumber >= INT_MAX) NextItemInstSerialNumber = 1; else NextItemInstSerialNumber++; @@ -1051,6 +1052,26 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo return SLOT_INVALID; } +void Inventory::dumpBagContents(ItemInst *inst, iter_inst *it) { + iter_contents itb; + + if (!inst || !inst->IsType(ItemClassContainer)) + return; + + // Go through bag, if bag + for (itb=inst->_begin(); itb!=inst->_end(); itb++) { + ItemInst* baginst = itb->second; + if(!baginst || !baginst->GetItem()) + continue; + + std::string subSlot; + StringFormat(subSlot," Slot %d: %s (%d)", Inventory::CalcSlotId((*it)->first, itb->first), + baginst->GetItem()->Name, (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges()); + std::cout << subSlot << std::endl; + } + +} + void Inventory::dumpItemCollection(const std::map &collection) { iter_inst it; iter_contents itb; diff --git a/common/ProcLauncher.cpp b/common/ProcLauncher.cpp index d2db2f6d4..da0cd81e9 100644 --- a/common/ProcLauncher.cpp +++ b/common/ProcLauncher.cpp @@ -15,21 +15,25 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + #include "debug.h" #include "ProcLauncher.h" #ifdef _WINDOWS -#include + #include #else -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include #endif ProcLauncher ProcLauncher::s_launcher; @@ -165,8 +169,8 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { // Create the child process. //glue together all the nice command line arguments - string args(it->program); - vector::iterator cur, end; + std::string args(it->program); + std::vector::iterator cur, end; cur = it->args.begin(); end = it->args.end(); for(; cur != end; cur++) { diff --git a/loginserver/Encryption.cpp b/loginserver/Encryption.cpp index 129ab18e3..290325ffe 100644 --- a/loginserver/Encryption.cpp +++ b/loginserver/Encryption.cpp @@ -19,9 +19,11 @@ #include "Encryption.h" #include "ErrorLog.h" +#include + extern ErrorLog *server_log; -bool Encryption::LoadCrypto(string name) +bool Encryption::LoadCrypto(std::string name) { if(!Load(name.c_str())) { diff --git a/zone/attack.cpp b/zone/attack.cpp index e8c009efd..7d428d6f8 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1476,7 +1476,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ if (killerMob != nullptr) { if (killerMob->IsNPC()) { - parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0); + parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0); mod_client_death_npc(killerMob); @@ -2124,7 +2124,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski /* Send the EVENT_KILLED_MERIT event for all raid members */ for (int i = 0; i < MAX_RAID_MEMBERS; i++) { if (kr->members[i].member != nullptr) { // If Group Member is Client - parse->EventNPC(EVENT_KILLED_MERIT, this, kr->members[i].member, "killed", 0); + parse->EventNPC(EVENT_KILLED_MERIT, this, kr->members[i].member, "killed", 0); mod_npc_killed_merit(kr->members[i].member); @@ -2167,7 +2167,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski for (int i = 0; i < MAX_GROUP_MEMBERS; i++) { if (kg->members[i] != nullptr && kg->members[i]->IsClient()) { // If Group Member is Client Client *c = kg->members[i]->CastToClient(); - parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0); + parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0); mod_npc_killed_merit(c); @@ -2214,7 +2214,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski } } /* Send the EVENT_KILLED_MERIT event */ - parse->EventNPC(EVENT_KILLED_MERIT, this, give_exp_client, "killed", 0); + parse->EventNPC(EVENT_KILLED_MERIT, this, give_exp_client, "killed", 0); mod_npc_killed_merit(give_exp_client); @@ -2347,7 +2347,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski // Parse quests even if we're killed by an NPC if(killerMob) { Mob *oos = killerMob->GetOwnerOrSelf(); - parse->EventNPC(EVENT_DEATH, this, oos, "", 0); + parse->EventNPC(EVENT_DEATH, this, oos, "", 0); mod_npc_killed(oos); @@ -4234,7 +4234,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ if(!RuleB(Combat, UseIntervalAC)){ if(IsNPC()){ //across the board NPC damage bonuses. - //only account for STR here, assume their base STR was factored into their DB damages + //only account for STR here, assume their base STR was factored into their DB damages int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; diff --git a/zone/bot.cpp b/zone/bot.cpp index 2de1796eb..c88ad72b7 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1576,7 +1576,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) return; } - for (map::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) { + for (std::map::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) { effect = iter->second.skill_id; base1 = iter->second.base1; base2 = iter->second.base2; @@ -4779,7 +4779,7 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) { std::list ActiveBots = Bot::GetGroupedBotsByGroupId(botOwner->GetGroup()->GetID(), &errorMessage); if(errorMessage.empty() && !ActiveBots.empty()) { - for(list::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); itr++) { + for(std::list::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); itr++) { Bot* activeBot = Bot::LoadBot(*itr, &errorMessage); if(!errorMessage.empty()) { @@ -6701,7 +6701,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id) return 0; } - for (map::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter) + for (std::map::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter) { effect = iter->second.skill_id; base1 = iter->second.base1; @@ -11136,7 +11136,7 @@ int32 Bot::CalcBaseEndurance() int BonusUpto800 = int( at_most_800 / 4 ) ; if(Stats > 400) { Bonus400to800 = int( (at_most_800 - 400) / 4 ); - HalfBonus400to800 = int( max( ( at_most_800 - 400 ), 0 ) / 8 ); + HalfBonus400to800 = int( std::max( ( at_most_800 - 400 ), 0 ) / 8 ); if(Stats > 800) { Bonus800plus = int( (Stats - 800) / 8 ) * 2; @@ -11598,7 +11598,7 @@ void Bot::ProcessClientZoneChange(Client* botOwner) { if(botOwner) { std::list BotList = entity_list.GetBotsByBotOwnerCharacterID(botOwner->CharacterID()); - for(list::iterator itr = BotList.begin(); itr != BotList.end(); itr++) { + for(std::list::iterator itr = BotList.begin(); itr != BotList.end(); itr++) { Bot* tempBot = *itr; if(tempBot) { @@ -12322,7 +12322,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(std::string(sep->arg[2]).compare("all") == 0) listAll = true; else { - string botName = std::string(sep->arg[2]); + std::string botName = std::string(sep->arg[2]); Bot* tempBot = entity_list.GetBotByBotName(botName); @@ -15981,12 +15981,12 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { Bot* leaderBot = *botListItr; if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) { //start all heal rotations - list rotationMemberList; + std::list rotationMemberList; int index = 0; rotationMemberList = GetBotsInHealRotation(leaderBot); - for(list::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) { + for(std::list::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) { Bot* tempBot = *rotationMemberItr; if(tempBot) { @@ -16014,7 +16014,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(leaderBot) { - list botList; + std::list botList; int index = 0; if (leaderBot->GetBotOwner() != c) { c->Message(13, "You must target a bot that you own."); @@ -16023,7 +16023,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { botList = GetBotsInHealRotation(leaderBot); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot) { @@ -16058,11 +16058,11 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { Bot* leaderBot = *botListItr; if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) { //start all heal rotations - list rotationMemberList; + std::list rotationMemberList; rotationMemberList = GetBotsInHealRotation(leaderBot); - for(list::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) { + for(std::list::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) { Bot* tempBot = *rotationMemberItr; if(tempBot) { @@ -16087,7 +16087,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(leaderBot) { - list botList; + std::list botList; if (leaderBot->GetBotOwner() != c) { c->Message(13, "You must target a bot that you own."); return; @@ -16095,7 +16095,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { botList = GetBotsInHealRotation(leaderBot); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) { @@ -16146,7 +16146,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(leaderBot) { - list botList; + std::list botList; if (leaderBot->GetBotOwner() != c) { c->Message(13, "You must target a bot that you own."); return; @@ -16158,7 +16158,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { c->Message(0, "Bot Heal Rotation- Leader: %s", leaderBot->GetCleanName()); c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f)); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) { @@ -16208,7 +16208,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(leaderBot) { - list botList; + std::list botList; if (leaderBot->GetBotOwner() != c) { c->Message(13, "You must target a bot that you own."); return; @@ -16216,7 +16216,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { botList = GetBotsInHealRotation(leaderBot); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) @@ -16248,7 +16248,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(leaderBot) { bool fastHeals = false; - list botList; + std::list botList; if (leaderBot->GetBotOwner() != c) { c->Message(13, "You must target a bot that you own."); return; @@ -16264,7 +16264,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { botList = GetBotsInHealRotation(leaderBot); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) @@ -16548,7 +16548,7 @@ Bot* EntityList::GetBotByBotID(uint32 botID) { Bot* Result = 0; if(botID > 0) { - for(list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { + for(std::list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot->GetBotID() == botID) { @@ -16565,7 +16565,7 @@ Bot* EntityList::GetBotByBotName(std::string botName) { Bot* Result = 0; if(!botName.empty()) { - for(list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { + for(std::list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && std::string(tempBot->GetName()) == botName) { @@ -16609,11 +16609,11 @@ void EntityList::AddBot(Bot *newBot, bool SendSpawnPacket, bool dontqueue) { } } -list EntityList::GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID) { - list Result; +std::list EntityList::GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID) { + std::list Result; if(botOwnerCharacterID > 0) { - for(list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { + for(std::list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot->GetBotOwnerCharacterID() == botOwnerCharacterID) @@ -16676,7 +16676,7 @@ bool EntityList::RemoveBot(uint16 entityID) { bool Result = false; if(entityID > 0) { - for(list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) + for(std::list::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { Bot* tempBot = *botListItr; @@ -16695,7 +16695,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) { const char *WindowTitle = "Bot Tracking Window"; - string WindowText; + std::string WindowText; int LastCon = -1; int CurrentCon = 0; @@ -17228,9 +17228,9 @@ bool Bot::AddHealRotationMember( Bot* healer ) { //update leader's previous member (end of list) to new member and update rotation data SetPrevHealRotationMember(healer); - list botList = GetBotsInHealRotation(this); + std::list botList = GetBotsInHealRotation(this); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot) @@ -17276,9 +17276,9 @@ bool Bot::RemoveHealRotationMember( Bot* healer ) { } //update rotation data - list botList = GetBotsInHealRotation(leader); + std::list botList = GetBotsInHealRotation(leader); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot) { @@ -17349,11 +17349,11 @@ bool Bot::AddHealRotationTarget( Mob* target ) { if (_healRotationTargets[i] == 0) { - list botList = GetBotsInHealRotation(this); + std::list botList = GetBotsInHealRotation(this); _healRotationTargets[i] = target->GetID(); - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot && tempBot != this) { @@ -17386,12 +17386,12 @@ bool Bot::RemoveHealRotationTarget( Mob* target ) { //notify all heal rotation members to remove target for(int i=0; iGetID()) { - list botList = GetBotsInHealRotation(this); + std::list botList = GetBotsInHealRotation(this); _healRotationTargets[i] = 0; index = i; removed = true; - for(list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { + for(std::list::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { Bot* tempBot = *botListItr; if(tempBot) @@ -17499,8 +17499,8 @@ Mob* Bot::GetHealRotationTarget( uint8 index ) { return target; } -list Bot::GetBotsInHealRotation(Bot* rotationLeader) { - list Result; +std::list Bot::GetBotsInHealRotation(Bot* rotationLeader) { + std::list Result; if(rotationLeader != nullptr) { Result.push_back(rotationLeader); diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 58d94d03b..10d3fa7af 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -559,7 +559,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { std::list inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff); - for(list::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); itr++) { + for(std::list::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); itr++) { BotSpell selectedBotSpell = *itr; if(selectedBotSpell.SpellId == 0) @@ -646,7 +646,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { const int maxDotSelect = 5; int dotSelectCounter = 0; - for(list::iterator itr = dotList.begin(); itr != dotList.end(); itr++) { + for(std::list::iterator itr = dotList.begin(); itr != dotList.end(); itr++) { BotSpell selectedBotSpell = *itr; if(selectedBotSpell.SpellId == 0) @@ -2049,7 +2049,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) { //Check for group cure first if(countNeedsCured > 2) { - for(list::iterator itr = cureList.begin(); itr != cureList.end(); itr++) { + for(std::list::iterator itr = cureList.begin(); itr != cureList.end(); itr++) { BotSpell selectedBotSpell = *itr; if(IsGroupSpell(itr->SpellId) && CheckSpellRecastTimers(botCaster, itr->SpellIndex)) { @@ -2086,7 +2086,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) { //no group cure for target- try to find single target spell if(!spellSelected) { - for(list::iterator itr = cureList.begin(); itr != cureList.end(); itr++) { + for(std::list::iterator itr = cureList.begin(); itr != cureList.end(); itr++) { BotSpell selectedBotSpell = *itr; if(CheckSpellRecastTimers(botCaster, itr->SpellIndex)) { diff --git a/zone/client.h b/zone/client.h index 21005949c..2a51bdca2 100644 --- a/zone/client.h +++ b/zone/client.h @@ -28,27 +28,38 @@ class Client; #include "../common/EQPacket.h" #include "../common/linked_list.h" #include "../common/extprofile.h" -#include "zonedb.h" -#include "errno.h" #include "../common/classes.h" #include "../common/races.h" #include "../common/deity.h" +#include "../common/seperator.h" +#include "../common/Item.h" +#include "../common/guilds.h" +#include "../common/item_struct.h" +#include "../common/clientversions.h" + +#include "zonedb.h" +#include "errno.h" #include "mob.h" #include "npc.h" #include "merc.h" #include "zone.h" #include "AA.h" -#include "../common/seperator.h" -#include "../common/Item.h" #include "updatemgr.h" -#include "../common/guilds.h" #include "questmgr.h" +#include "QGlobals.h" + +#ifdef _WINDOWS + // since windows defines these within windef.h (which windows.h include) + // we are required to undefine these to use min and max from + #undef min + #undef max +#endif + #include #include #include -#include "../common/item_struct.h" -#include "../common/clientversions.h" -#include "QGlobals.h" +#include + #define CLIENT_TIMEOUT 90000 #define CLIENT_LD_TIMEOUT 30000 // length of time client stays in zone after LDing @@ -1101,7 +1112,7 @@ public: void DuplicateLoreMessage(uint32 ItemID); void GarbleMessage(char *, uint8); - void TickItemCheck(); + void TickItemCheck(); void TryItemTick(int slot); int16 GetActSTR() { return( std::min(GetMaxSTR(), GetSTR()) ); } int16 GetActSTA() { return( std::min(GetMaxSTA(), GetSTA()) ); } @@ -1110,9 +1121,9 @@ public: int16 GetActINT() { return( std::min(GetMaxINT(), GetINT()) ); } int16 GetActWIS() { return( std::min(GetMaxWIS(), GetWIS()) ); } int16 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); } - void LoadAccountFlags(); - void SetAccountFlag(std::string flag, std::string val); - std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillType); + void LoadAccountFlags(); + void SetAccountFlag(std::string flag, std::string val); + std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillType); int mod_client_damage(int damage, SkillType skillinuse, int hand, ItemInst* weapon, Mob* other); bool mod_client_message(char* message, uint8 chan_num); bool mod_can_increase_skill(SkillType skillid, Mob* against_who); @@ -1431,9 +1442,9 @@ private: uint8 MaxXTargets; bool XTargetAutoAddHaters; - struct XTarget_Struct XTargets[XTARGET_HARDCAP]; + struct XTarget_Struct XTargets[XTARGET_HARDCAP]; - Timer ItemTickTimer; + Timer ItemTickTimer; std::map accountflags; }; diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 5ed426789..73774ca6b 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -15,19 +15,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "../common/debug.h" -#include "masterentity.h" -#include "worldserver.h" -#include "zonedb.h" #include "../common/spdat.h" #include "../common/packet_dump.h" #include "../common/packet_functions.h" -#include "petitions.h" #include "../common/serverinfo.h" #include "../common/ZoneNumbers.h" #include "../common/moremath.h" #include "../common/guilds.h" #include "../common/logsys.h" +#include "masterentity.h" +#include "worldserver.h" +#include "zonedb.h" +#include "petitions.h" #include "StringIDs.h" #include "NpcAI.h" diff --git a/zone/entity.h b/zone/entity.h index 812d229bb..9d25ceeeb 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -20,12 +20,13 @@ #include "../common/types.h" #include "../common/linked_list.h" -#include "zonedb.h" -#include "../common/eq_constants.h" -#include "zonedump.h" -#include "zonedbasync.h" #include "../common/servertalk.h" #include "../common/bodytypes.h" +#include "../common/eq_constants.h" + +#include "zonedb.h" +#include "zonedump.h" +#include "zonedbasync.h" #include "QGlobals.h" // max number of newspawns to send per bulk packet @@ -441,7 +442,7 @@ private: Mob* GetMobByBotID(uint32 botID); Bot* GetBotByBotID(uint32 botID); Bot* GetBotByBotName(std::string botName); - list GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID); + std::list GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID); bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate void ShowSpawnWindow(Client* client, int Distance, bool NamedOnly); // TODO: Implement ShowSpawnWindow in the bot class but it needs entity list stuff