From 71774e0df3c21e90fbc0b46c1360ea27e2ea9f6b Mon Sep 17 00:00:00 2001 From: Gladie Date: Sat, 11 Oct 2025 11:02:43 +0200 Subject: [PATCH 1/4] Update CCharFight.cpp fix pets memory being removed --- src/game/chars/CCharFight.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 10e6451f8..b5df78f39 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -355,8 +355,11 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal) wMemTypes |= MEMORY_AGGREIVED; } } - Memory_AddObjTypes(pCharSrc, wMemTypes); - Attacker_Add(pCharSrc); + if (pCharSrc != this && pCharSrc != GetOwner()) + { + Memory_AddObjTypes(pCharSrc, wMemTypes); + Attacker_Add(pCharSrc); + } if ((Noto_GetFlag(pCharSrc) == NOTO_GOOD) && fAggreived ) { From cadbf305748a609069db9c543a0b708c328371e0 Mon Sep 17 00:00:00 2001 From: Gladie Date: Sun, 12 Oct 2025 14:39:37 +0200 Subject: [PATCH 2/4] Update CCharFight.cpp check is already above --- src/game/chars/CCharFight.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index b5df78f39..5303dae9b 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -355,7 +355,7 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal) wMemTypes |= MEMORY_AGGREIVED; } } - if (pCharSrc != this && pCharSrc != GetOwner()) + if (pCharSrc != GetOwner()) { Memory_AddObjTypes(pCharSrc, wMemTypes); Attacker_Add(pCharSrc); From 10e8d1d33971a64802504b149d71a3718df3065b Mon Sep 17 00:00:00 2001 From: Gladie Date: Sun, 12 Oct 2025 15:07:47 +0200 Subject: [PATCH 3/4] Revert "Update CCharFight.cpp" This reverts commit cadbf305748a609069db9c543a0b708c328371e0. --- src/game/chars/CCharFight.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 5303dae9b..b5df78f39 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -355,7 +355,7 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal) wMemTypes |= MEMORY_AGGREIVED; } } - if (pCharSrc != GetOwner()) + if (pCharSrc != this && pCharSrc != GetOwner()) { Memory_AddObjTypes(pCharSrc, wMemTypes); Attacker_Add(pCharSrc); From f80490538aed630ef4f671b86604b3e46859907d Mon Sep 17 00:00:00 2001 From: Gladie Date: Sun, 12 Oct 2025 16:18:16 +0200 Subject: [PATCH 4/4] Update CCharFight.cpp better fix for pets --- src/game/chars/CCharFight.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index b5df78f39..17fc7a291 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -355,11 +355,8 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal) wMemTypes |= MEMORY_AGGREIVED; } } - if (pCharSrc != this && pCharSrc != GetOwner()) - { - Memory_AddObjTypes(pCharSrc, wMemTypes); - Attacker_Add(pCharSrc); - } + Memory_AddObjTypes(pCharSrc, wMemTypes); + Attacker_Add(pCharSrc); if ((Noto_GetFlag(pCharSrc) == NOTO_GOOD) && fAggreived ) { @@ -1375,8 +1372,9 @@ bool CChar::Fight_Clear(CChar *pChar, bool fForced) m_atFight.m_iSwingIgnoreLastHitTag = 0; CItemMemory* pMemoryFight = Memory_FindObj(m_Fight_Targ_UID); - if ( pMemoryFight && ( pMemoryFight->IsMemoryTypes(MEMORY_FIGHT) || pMemoryFight->IsMemoryTypes(MEMORY_IRRITATEDBY) ) ) - pMemoryFight->Delete(); + if (pMemoryFight && (pMemoryFight->IsMemoryTypes(MEMORY_FIGHT) || pMemoryFight->IsMemoryTypes(MEMORY_IRRITATEDBY)) && + !pMemoryFight->IsMemoryTypes(MEMORY_IPET)) + pMemoryFight->Delete(); // Go to my next target. if (m_Fight_Targ_UID == pChar->GetUID())