From aff481bd371da37d9ac3ef1a1287f92754e34f91 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 25 Mar 2018 01:12:22 -0400 Subject: [PATCH 1/3] Fix invalid read in con --- zone/client_packet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index fe8af2a98..6483c0cb2 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -4833,7 +4833,6 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) mod_consider(tmob, con); QueuePacket(outapp); - safe_delete(outapp); // only wanted to check raid target once // and need con to still be around so, do it here! if (tmob->IsRaidTarget()) { @@ -4880,6 +4879,8 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) else if ((invisible || invisible_undead || hidden || invisible_animals) && !IsInvisible(tmob)) Message_StringID(10, SUSPECT_SEES_YOU); + safe_delete(outapp); + return; } From 137d2d723d9ff86af9faeaf706267b6a2efb80f0 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 25 Mar 2018 01:16:06 -0400 Subject: [PATCH 2/3] Initialize AISpellVar --- zone/npc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/zone/npc.cpp b/zone/npc.cpp index b9aec3abb..edd6e5673 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -399,6 +399,19 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if raid_target = d->raid_target; ignore_despawn = d->ignore_despawn; m_targetable = !d->untargetable; + + AISpellVar.fail_recast = RuleI(Spells, AI_SpellCastFinishedFailRecast); + AISpellVar.engaged_no_sp_recast_min = RuleI(Spells, AI_EngagedNoSpellMinRecast); + AISpellVar.engaged_no_sp_recast_max = RuleI(Spells, AI_EngagedNoSpellMaxRecast); + AISpellVar.engaged_beneficial_self_chance = RuleI(Spells, AI_EngagedBeneficialSelfChance); + AISpellVar.engaged_beneficial_other_chance = RuleI(Spells, AI_EngagedBeneficialOtherChance); + AISpellVar.engaged_detrimental_chance = RuleI(Spells, AI_EngagedDetrimentalChance); + AISpellVar.pursue_no_sp_recast_min = RuleI(Spells, AI_PursueNoSpellMinRecast); + AISpellVar.pursue_no_sp_recast_max = RuleI(Spells, AI_PursueNoSpellMaxRecast); + AISpellVar.pursue_detrimental_chance = RuleI(Spells, AI_PursueDetrimentalChance); + AISpellVar.idle_no_sp_recast_min = RuleI(Spells, AI_IdleNoSpellMinRecast); + AISpellVar.idle_no_sp_recast_max = RuleI(Spells, AI_IdleNoSpellMaxRecast); + AISpellVar.idle_beneficial_chance = RuleI(Spells, AI_IdleBeneficialChance); } NPC::~NPC() From 5b5c3a08e62f4ddd2017f4441cb3d5949a4ce38c Mon Sep 17 00:00:00 2001 From: Kinglykrab Date: Sun, 25 Mar 2018 14:33:38 -0400 Subject: [PATCH 3/3] Fix TryMoveAlong() in Perl. - Didn't have 4th option accounted for (my bad). --- zone/perl_mob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 35f26cfc7..cb30cf809 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -9402,7 +9402,7 @@ XS(boot_Mob) newXSproto(strcpy(buf, "IsSilenced"), XS_Mob_IsSilenced, file, "$"); newXSproto(strcpy(buf, "IsAmnesiad"), XS_Mob_IsAmnesiad, file, "$"); newXSproto(strcpy(buf, "GetMeleeMitigation"), XS_Mob_GetMeleeMitigation, file, "$"); - newXSproto(strcpy(buf, "TryMoveAlong"), XS_Mob_TryMoveAlong, file, "$$;$"); + newXSproto(strcpy(buf, "TryMoveAlong"), XS_Mob_TryMoveAlong, file, "$$$;$"); XSRETURN_YES; }