diff --git a/changelog.txt b/changelog.txt index 1ef3af6fd..66ffe50d7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,9 @@ Bad_Captain: Fixed merc buffing bugs. Bad_Captain: Added checks before dismissing merc to prevent possible bugged mercs. Bad_Captain: Merged in Secret's merc memory leak fixes. +== 03/20/2013 == +demonstar55: Fixed stacking issues with SE_Limit* (ex. Unholy Aura Discipline and Aura of Reverence) + == 03/18/2013 == Bad_Captain: Fixed zone crash due to merc focus effects & tribute. Bad_Captain: Fixed merc aggro issues when client in melee range & spell recast timers. diff --git a/common/patches/RoF.cpp b/common/patches/RoF.cpp index 1c56e27cd..b44cb8f37 100644 --- a/common/patches/RoF.cpp +++ b/common/patches/RoF.cpp @@ -3150,6 +3150,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); + *p = NULL; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -3174,7 +3175,7 @@ ENCODE(OP_VetRewardsAvaliable) } dest->FastQueuePacket(&outapp_create); - delete[] __emu_buffer; + delete inapp; } ENCODE(OP_WhoAllResponse) diff --git a/common/patches/SoD.cpp b/common/patches/SoD.cpp index 99e6cd8c0..9e272a14c 100644 --- a/common/patches/SoD.cpp +++ b/common/patches/SoD.cpp @@ -2097,6 +2097,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); + *p = NULL; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -2121,7 +2122,7 @@ ENCODE(OP_VetRewardsAvaliable) } dest->FastQueuePacket(&outapp_create); - delete[] __emu_buffer; + delete inapp; } ENCODE(OP_WhoAllResponse) diff --git a/common/patches/SoF.cpp b/common/patches/SoF.cpp index b2794d9af..873f3f19d 100644 --- a/common/patches/SoF.cpp +++ b/common/patches/SoF.cpp @@ -1735,6 +1735,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); + *p = NULL; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -1759,7 +1760,7 @@ ENCODE(OP_VetRewardsAvaliable) } dest->FastQueuePacket(&outapp_create); - delete[] __emu_buffer; + delete inapp; } ENCODE(OP_DeleteSpawn) { diff --git a/common/patches/Titanium.cpp b/common/patches/Titanium.cpp index 469ba9b57..8f4624bed 100644 --- a/common/patches/Titanium.cpp +++ b/common/patches/Titanium.cpp @@ -898,6 +898,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); + *p = NULL; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -916,7 +917,7 @@ ENCODE(OP_VetRewardsAvaliable) } dest->FastQueuePacket(&outapp_create); - delete[] __emu_buffer; + delete inapp; } ENCODE(OP_InspectAnswer) { diff --git a/common/patches/Underfoot.cpp b/common/patches/Underfoot.cpp index 0da4f60c9..d56a21d3b 100644 --- a/common/patches/Underfoot.cpp +++ b/common/patches/Underfoot.cpp @@ -2157,6 +2157,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); + *p = NULL; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -2181,7 +2182,7 @@ ENCODE(OP_VetRewardsAvaliable) } dest->FastQueuePacket(&outapp_create); - delete[] __emu_buffer; + delete inapp; } ENCODE(OP_WhoAllResponse) diff --git a/zone/merc.cpp b/zone/merc.cpp index a76bb4a91..e078efec4 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -37,9 +37,11 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading) _baseFR = d->FR; _basePR = d->PR; _baseCorrup = d->Corrup; + _OwnerClientVersion = EQClientTitanium; RestRegenHP = 0; RestRegenMana = 0; RestRegenEndurance = 0; + cur_end = 0; _medding = false; _suspended = false; @@ -2750,7 +2752,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { int16 focus_max_real = 0; //item focus - for(int x=0; x<=MAX_WORN_INVENTORY; x++) + for(int x =0; x < MAX_WORN_INVENTORY; ++x) { TempItem = NULL; if (equipment[x] == 0) diff --git a/zone/mob.cpp b/zone/mob.cpp index 8bd2d362c..6c8bbc398 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -274,7 +274,7 @@ Mob::Mob(const char* in_name, memset(&itembonuses, 0, sizeof(StatBonuses)); memset(&spellbonuses, 0, sizeof(StatBonuses)); - //memset(&aabonuses, 0, sizeof(StatBonuses)); //don't need this until we start using Client::CalcAABonuses() + memset(&aabonuses, 0, sizeof(StatBonuses)); spellbonuses.AggroRange = -1; spellbonuses.AssistRange = -1; pLastChange = 0; diff --git a/zone/spells.cpp b/zone/spells.cpp index 6d624bfae..5c85b4445 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2564,6 +2564,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if(effect1 != effect2) continue; + /* + Skip check if effect is SE_Limit* + skip checking effect2 since we know they are equal + */ + if(effect1 == SE_LimitMaxLevel || + effect1 == SE_LimitResist || + effect1 == SE_LimitTarget || + effect1 == SE_LimitEffect || + effect1 == SE_LimitSpellType || + effect1 == SE_LimitSpell || + effect1 == SE_LimitMinDur || + effect1 == SE_LimitInstant || + effect1 == SE_LimitMinLevel || + effect1 == SE_LimitCastTime) + continue; + /* If target is a npc and caster1 and caster2 exist If Caster1 isn't the same as Caster2 and the effect is a DoT then ignore it. diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 46604282f..6e2953534 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1885,7 +1885,6 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { } safe_delete_array(Query); - Query = 0; if(errorMessage.empty() && BuffsLoaded) { if(!database.RunQuery(Query, MakeAnyLenString(&Query, "DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()), TempErrorMessageBuffer)) {