SecretsOTheP 2013-11-22 15:32:02 -05:00
parent 093af6af0b
commit 2f8cbb3a9d
2 changed files with 18 additions and 15 deletions

View File

@ -580,15 +580,17 @@ void Client::CalcAABonuses(StatBonuses* newbon) {
uint32 slots = 0; uint32 slots = 0;
uint32 aa_AA = 0; uint32 aa_AA = 0;
uint32 aa_value = 0; uint32 aa_value = 0;
for (i = 0; i < MAX_PP_AA_ARRAY; i++) { //iterate through all of the client's AAs if(this->aa) {
if (this->aa[i]) { // make sure aa exists or we'll crash zone for (i = 0; i < MAX_PP_AA_ARRAY; i++) { //iterate through all of the client's AAs
aa_AA = this->aa[i]->AA; //same as aaid from the aa_effects table if (this->aa[i]) { // make sure aa exists or we'll crash zone
aa_value = this->aa[i]->value; //how many points in it aa_AA = this->aa[i]->AA; //same as aaid from the aa_effects table
if (aa_AA > 0 || aa_value > 0) { //do we have the AA? if 1 of the 2 is set, we can assume we do aa_value = this->aa[i]->value; //how many points in it
//slots = database.GetTotalAALevels(aa_AA); //find out how many effects from aa_effects table if (aa_AA > 0 || aa_value > 0) { //do we have the AA? if 1 of the 2 is set, we can assume we do
slots = zone->GetTotalAALevels(aa_AA); //find out how many effects from aa_effects, which is loaded into memory //slots = database.GetTotalAALevels(aa_AA); //find out how many effects from aa_effects table
if (slots > 0) //and does it have any effects? may be able to put this above, not sure if it runs on each iteration slots = zone->GetTotalAALevels(aa_AA); //find out how many effects from aa_effects, which is loaded into memory
ApplyAABonuses(aa_AA, slots, newbon); //add the bonuses if (slots > 0) //and does it have any effects? may be able to put this above, not sure if it runs on each iteration
ApplyAABonuses(aa_AA, slots, newbon); //add the bonuses
}
} }
} }
} }

View File

@ -494,12 +494,13 @@ bool Mob::DoCastingChecks()
uint16 spell_id = casting_spell_id; uint16 spell_id = casting_spell_id;
Mob *spell_target = entity_list.GetMob(casting_spell_targetid); Mob *spell_target = entity_list.GetMob(casting_spell_targetid);
if (RuleB(Spells, BuffLevelRestrictions) && if (RuleB(Spells, BuffLevelRestrictions)) {
!spell_target->CheckSpellLevelRestriction(spell_id)) { if(spell_target && !spell_target->CheckSpellLevelRestriction(spell_id)) {
mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id); mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id);
if (!IsBardSong(spell_id)) if (!IsBardSong(spell_id))
Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL);
return false; return false;
}
} }
if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) { if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) {