Merge pull request #64 from af4t/master

Windows compile fix: bots
This commit is contained in:
Alex 2013-05-23 12:30:06 -07:00
commit 12ddd30f67
3 changed files with 42 additions and 42 deletions

View File

@ -1575,7 +1575,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
return; return;
} }
for (map<uint32, AA_Ability>::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) { for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) {
effect = iter->second.skill_id; effect = iter->second.skill_id;
base1 = iter->second.base1; base1 = iter->second.base1;
base2 = iter->second.base2; base2 = iter->second.base2;
@ -4778,7 +4778,7 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) {
std::list<uint32> ActiveBots = Bot::GetGroupedBotsByGroupId(botOwner->GetGroup()->GetID(), &errorMessage); std::list<uint32> ActiveBots = Bot::GetGroupedBotsByGroupId(botOwner->GetGroup()->GetID(), &errorMessage);
if(errorMessage.empty() && !ActiveBots.empty()) { if(errorMessage.empty() && !ActiveBots.empty()) {
for(list<uint32>::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); itr++) { for(std::list<uint32>::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); itr++) {
Bot* activeBot = Bot::LoadBot(*itr, &errorMessage); Bot* activeBot = Bot::LoadBot(*itr, &errorMessage);
if(!errorMessage.empty()) { if(!errorMessage.empty()) {
@ -6700,7 +6700,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
return 0; return 0;
} }
for (map<uint32, AA_Ability>::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter) for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter)
{ {
effect = iter->second.skill_id; effect = iter->second.skill_id;
base1 = iter->second.base1; base1 = iter->second.base1;
@ -11135,7 +11135,7 @@ int32 Bot::CalcBaseEndurance()
int BonusUpto800 = int( at_most_800 / 4 ) ; int BonusUpto800 = int( at_most_800 / 4 ) ;
if(Stats > 400) { if(Stats > 400) {
Bonus400to800 = int( (at_most_800 - 400) / 4 ); 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) { if(Stats > 800) {
Bonus800plus = int( (Stats - 800) / 8 ) * 2; Bonus800plus = int( (Stats - 800) / 8 ) * 2;
@ -11597,7 +11597,7 @@ void Bot::ProcessClientZoneChange(Client* botOwner) {
if(botOwner) { if(botOwner) {
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(botOwner->CharacterID()); std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(botOwner->CharacterID());
for(list<Bot*>::iterator itr = BotList.begin(); itr != BotList.end(); itr++) { for(std::list<Bot*>::iterator itr = BotList.begin(); itr != BotList.end(); itr++) {
Bot* tempBot = *itr; Bot* tempBot = *itr;
if(tempBot) { if(tempBot) {
@ -12321,7 +12321,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
if(std::string(sep->arg[2]).compare("all") == 0) if(std::string(sep->arg[2]).compare("all") == 0)
listAll = true; listAll = true;
else { else {
string botName = std::string(sep->arg[2]); std::string botName = std::string(sep->arg[2]);
Bot* tempBot = entity_list.GetBotByBotName(botName); Bot* tempBot = entity_list.GetBotByBotName(botName);
@ -15980,12 +15980,12 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
Bot* leaderBot = *botListItr; Bot* leaderBot = *botListItr;
if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) { if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) {
//start all heal rotations //start all heal rotations
list<Bot*> rotationMemberList; std::list<Bot*> rotationMemberList;
int index = 0; int index = 0;
rotationMemberList = GetBotsInHealRotation(leaderBot); rotationMemberList = GetBotsInHealRotation(leaderBot);
for(list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) { for(std::list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) {
Bot* tempBot = *rotationMemberItr; Bot* tempBot = *rotationMemberItr;
if(tempBot) { if(tempBot) {
@ -16013,7 +16013,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
} }
if(leaderBot) { if(leaderBot) {
list<Bot*> botList; std::list<Bot*> botList;
int index = 0; int index = 0;
if (leaderBot->GetBotOwner() != c) { if (leaderBot->GetBotOwner() != c) {
c->Message(13, "You must target a bot that you own."); c->Message(13, "You must target a bot that you own.");
@ -16022,7 +16022,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
botList = GetBotsInHealRotation(leaderBot); botList = GetBotsInHealRotation(leaderBot);
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot) { if(tempBot) {
@ -16057,11 +16057,11 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
Bot* leaderBot = *botListItr; Bot* leaderBot = *botListItr;
if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) { if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) {
//start all heal rotations //start all heal rotations
list<Bot*> rotationMemberList; std::list<Bot*> rotationMemberList;
rotationMemberList = GetBotsInHealRotation(leaderBot); rotationMemberList = GetBotsInHealRotation(leaderBot);
for(list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) { for(std::list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) {
Bot* tempBot = *rotationMemberItr; Bot* tempBot = *rotationMemberItr;
if(tempBot) { if(tempBot) {
@ -16086,7 +16086,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
} }
if(leaderBot) { if(leaderBot) {
list<Bot*> botList; std::list<Bot*> botList;
if (leaderBot->GetBotOwner() != c) { if (leaderBot->GetBotOwner() != c) {
c->Message(13, "You must target a bot that you own."); c->Message(13, "You must target a bot that you own.");
return; return;
@ -16094,7 +16094,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
botList = GetBotsInHealRotation(leaderBot); botList = GetBotsInHealRotation(leaderBot);
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) { if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) {
@ -16145,7 +16145,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
} }
if(leaderBot) { if(leaderBot) {
list<Bot*> botList; std::list<Bot*> botList;
if (leaderBot->GetBotOwner() != c) { if (leaderBot->GetBotOwner() != c) {
c->Message(13, "You must target a bot that you own."); c->Message(13, "You must target a bot that you own.");
return; return;
@ -16157,7 +16157,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- Leader: %s", leaderBot->GetCleanName());
c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f)); c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f));
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) { if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) {
@ -16207,7 +16207,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
} }
if(leaderBot) { if(leaderBot) {
list<Bot*> botList; std::list<Bot*> botList;
if (leaderBot->GetBotOwner() != c) { if (leaderBot->GetBotOwner() != c) {
c->Message(13, "You must target a bot that you own."); c->Message(13, "You must target a bot that you own.");
return; return;
@ -16215,7 +16215,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
botList = GetBotsInHealRotation(leaderBot); botList = GetBotsInHealRotation(leaderBot);
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID())
@ -16247,7 +16247,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
if(leaderBot) { if(leaderBot) {
bool fastHeals = false; bool fastHeals = false;
list<Bot*> botList; std::list<Bot*> botList;
if (leaderBot->GetBotOwner() != c) { if (leaderBot->GetBotOwner() != c) {
c->Message(13, "You must target a bot that you own."); c->Message(13, "You must target a bot that you own.");
return; return;
@ -16263,7 +16263,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
botList = GetBotsInHealRotation(leaderBot); botList = GetBotsInHealRotation(leaderBot);
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID())
@ -16547,7 +16547,7 @@ Bot* EntityList::GetBotByBotID(uint32 botID) {
Bot* Result = 0; Bot* Result = 0;
if(botID > 0) { if(botID > 0) {
for(list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot->GetBotID() == botID) { if(tempBot && tempBot->GetBotID() == botID) {
@ -16564,7 +16564,7 @@ Bot* EntityList::GetBotByBotName(std::string botName) {
Bot* Result = 0; Bot* Result = 0;
if(!botName.empty()) { if(!botName.empty()) {
for(list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && std::string(tempBot->GetName()) == botName) { if(tempBot && std::string(tempBot->GetName()) == botName) {
@ -16608,11 +16608,11 @@ void EntityList::AddBot(Bot *newBot, bool SendSpawnPacket, bool dontqueue) {
} }
} }
list<Bot*> EntityList::GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID) { std::list<Bot*> EntityList::GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID) {
list<Bot*> Result; std::list<Bot*> Result;
if(botOwnerCharacterID > 0) { if(botOwnerCharacterID > 0) {
for(list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot->GetBotOwnerCharacterID() == botOwnerCharacterID) if(tempBot && tempBot->GetBotOwnerCharacterID() == botOwnerCharacterID)
@ -16675,7 +16675,7 @@ bool EntityList::RemoveBot(uint16 entityID) {
bool Result = false; bool Result = false;
if(entityID > 0) { if(entityID > 0) {
for(list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++)
{ {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
@ -16694,7 +16694,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {
const char *WindowTitle = "Bot Tracking Window"; const char *WindowTitle = "Bot Tracking Window";
string WindowText; std::string WindowText;
int LastCon = -1; int LastCon = -1;
int CurrentCon = 0; int CurrentCon = 0;
@ -17227,9 +17227,9 @@ bool Bot::AddHealRotationMember( Bot* healer ) {
//update leader's previous member (end of list) to new member and update rotation data //update leader's previous member (end of list) to new member and update rotation data
SetPrevHealRotationMember(healer); SetPrevHealRotationMember(healer);
list<Bot*> botList = GetBotsInHealRotation(this); std::list<Bot*> botList = GetBotsInHealRotation(this);
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot) if(tempBot)
@ -17275,9 +17275,9 @@ bool Bot::RemoveHealRotationMember( Bot* healer ) {
} }
//update rotation data //update rotation data
list<Bot*> botList = GetBotsInHealRotation(leader); std::list<Bot*> botList = GetBotsInHealRotation(leader);
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot) { if(tempBot) {
@ -17348,11 +17348,11 @@ bool Bot::AddHealRotationTarget( Mob* target ) {
if (_healRotationTargets[i] == 0) if (_healRotationTargets[i] == 0)
{ {
list<Bot*> botList = GetBotsInHealRotation(this); std::list<Bot*> botList = GetBotsInHealRotation(this);
_healRotationTargets[i] = target->GetID(); _healRotationTargets[i] = target->GetID();
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot && tempBot != this) { if(tempBot && tempBot != this) {
@ -17385,12 +17385,12 @@ bool Bot::RemoveHealRotationTarget( Mob* target ) {
//notify all heal rotation members to remove target //notify all heal rotation members to remove target
for(int i=0; i<MaxHealRotationTargets; i++){ for(int i=0; i<MaxHealRotationTargets; i++){
if(_healRotationTargets[i] == target->GetID()) { if(_healRotationTargets[i] == target->GetID()) {
list<Bot*> botList = GetBotsInHealRotation(this); std::list<Bot*> botList = GetBotsInHealRotation(this);
_healRotationTargets[i] = 0; _healRotationTargets[i] = 0;
index = i; index = i;
removed = true; removed = true;
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) { for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
Bot* tempBot = *botListItr; Bot* tempBot = *botListItr;
if(tempBot) if(tempBot)
@ -17498,8 +17498,8 @@ Mob* Bot::GetHealRotationTarget( uint8 index ) {
return target; return target;
} }
list<Bot*> Bot::GetBotsInHealRotation(Bot* rotationLeader) { std::list<Bot*> Bot::GetBotsInHealRotation(Bot* rotationLeader) {
list<Bot*> Result; std::list<Bot*> Result;
if(rotationLeader != nullptr) { if(rotationLeader != nullptr) {
Result.push_back(rotationLeader); Result.push_back(rotationLeader);

View File

@ -558,7 +558,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
std::list<BotSpell> inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff); std::list<BotSpell> inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff);
for(list<BotSpell>::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); itr++) { for(std::list<BotSpell>::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); itr++) {
BotSpell selectedBotSpell = *itr; BotSpell selectedBotSpell = *itr;
if(selectedBotSpell.SpellId == 0) if(selectedBotSpell.SpellId == 0)
@ -645,7 +645,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
const int maxDotSelect = 5; const int maxDotSelect = 5;
int dotSelectCounter = 0; int dotSelectCounter = 0;
for(list<BotSpell>::iterator itr = dotList.begin(); itr != dotList.end(); itr++) { for(std::list<BotSpell>::iterator itr = dotList.begin(); itr != dotList.end(); itr++) {
BotSpell selectedBotSpell = *itr; BotSpell selectedBotSpell = *itr;
if(selectedBotSpell.SpellId == 0) if(selectedBotSpell.SpellId == 0)
@ -2048,7 +2048,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
//Check for group cure first //Check for group cure first
if(countNeedsCured > 2) { if(countNeedsCured > 2) {
for(list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) { for(std::list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
BotSpell selectedBotSpell = *itr; BotSpell selectedBotSpell = *itr;
if(IsGroupSpell(itr->SpellId) && CheckSpellRecastTimers(botCaster, itr->SpellIndex)) { if(IsGroupSpell(itr->SpellId) && CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
@ -2085,7 +2085,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
//no group cure for target- try to find single target spell //no group cure for target- try to find single target spell
if(!spellSelected) { if(!spellSelected) {
for(list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) { for(std::list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
BotSpell selectedBotSpell = *itr; BotSpell selectedBotSpell = *itr;
if(CheckSpellRecastTimers(botCaster, itr->SpellIndex)) { if(CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {

View File

@ -441,7 +441,7 @@ private:
Mob* GetMobByBotID(uint32 botID); Mob* GetMobByBotID(uint32 botID);
Bot* GetBotByBotID(uint32 botID); Bot* GetBotByBotID(uint32 botID);
Bot* GetBotByBotName(std::string botName); Bot* GetBotByBotName(std::string botName);
list<Bot*> GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID); std::list<Bot*> GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID);
bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate 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 void ShowSpawnWindow(Client* client, int Distance, bool NamedOnly); // TODO: Implement ShowSpawnWindow in the bot class but it needs entity list stuff