Skip to content

Conversation

@GladieUO
Copy link
Contributor

So the issue is described in the #1472.
Basically your pet, if you hit him or cause dmg will lose flag memory_ipet from its memory after its done fighting, and goes back to "guarding" or "following you". After some delay, pet will start attacking you which is signal the memory is gone, and he is no longer your pet. However, he is still stuck in followerslots.

I found out this way you can protect it, so the memory_AddObjTypes are called only if its not your owner, and also no reason to call Attacker_Add on your owner.

This fix is working, pets are no longer missing memory_ipet after fight. Sometimes they still attack you back once they come to you, but thats probably normal since you didnt call any command yet, and they still remember you damaged them.

fix pets memory being removed
@mtwango
Copy link
Member

mtwango commented Oct 12, 2025

Isn't the pCharSrc == this check implemented at the beggining?

Feels more like a workaround to the issue: not applying the memory instead of fixing, why the memory goes away.

@GladieUO
Copy link
Contributor Author

GladieUO commented Oct 12, 2025

Isn't the pCharSrc == this check implemented at the beggining?

Feels more like a workaround to the issue: not applying the memory instead of fixing, why the memory goes away.

Yes it is - however without it, it happenes again. 😁
And yes its workaround, I tried to fix Memory_AddObjTypes, and down the line a tree, but no matter what, the memory got wrongly changed always. If anyone can fix it properly i'd be more than happy, however I cant afford to let this bug be on live shard.
You can close this PR if you want.

check is already above
better fix for pets
@GladieUO
Copy link
Contributor Author

GladieUO commented Oct 12, 2025

Latest change might be a more proper fix, as in here, the attacker combat memories are cleared, after the fight ends, however it doesnt check if by chance the memory isnt holding also memory_ipet of your owner....

@mtwango
Copy link
Member

mtwango commented Oct 12, 2025

Good thinking. So to sumarize: when you enter combat, you will get memory object linked to combatant or your existing memory will get flags. After combat, the memory gets removed, even if it has other flags.
Maybe after combat removing the combat flags and if it has none afterwards delete it? Or check only for pet memory and remove combat flags from it, instead of ignoring it

@GladieUO
Copy link
Contributor Author

Good thinking. So to sumarize: when you enter combat, you will get memory object linked to combatant or your existing memory will get flags. After combat, the memory gets removed, even if it has other flags. Maybe after combat removing the combat flags and if it has none afterwards delete it? Or check only for pet memory and remove combat flags from it, instead of ignoring it

Im not sure what should be default behaviour. Keeping the combat flags on your owner memory or not. It kinda feel natural that the pet will still try to hit you after combat ends and he comes back to you, unless you commands him again. But in the same time, it feels weird.

@DavideRei
Copy link
Contributor

DavideRei commented Oct 21, 2025

I'd fix it like this, if there is memory_ipet change the color to hold only memory_ipet (so even the pet stop the combat), if not remove the memory.

CItemMemory* pMemoryFight =  Memory_FindObj(m_Fight_Targ_UID);

if (pMemoryFight && (pMemoryFight->IsMemoryTypes(MEMORY_FIGHT) || pMemoryFight->IsMemoryTypes(MEMORY_IRRITATEDBY)))
{
    if (pMemoryFight->IsMemoryTypes(MEMORY_IPET))
        pMemoryFight->SetMemoryTypes(MEMORY_IPET);
    else
        pMemoryFight->Delete();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants