Skip to content

Conversation

@GladieUO
Copy link
Contributor

@GladieUO GladieUO commented Jan 5, 2026

Casting was aborted if other monster with attacker (me) died. Because Attacker_Clear nulls the ACTARG1 (which is spell def during cast). #1539

Casting was aborted if other monster with attacker (me) died. Because of melee stuff clearing the ACTARG1 was nulled. Sphereserver#1539
@GladieUO
Copy link
Contributor Author

GladieUO commented Jan 6, 2026

It might be also related to the pets bug, where the ACTARG1 on pet is being anulled and thus the link to its figurine is gone.
It might proabbly happend in moment when you shrink pet, but at same time the monster dies and triggers attacker_clear on pet being shrinked.
#1505

@mtwango
Copy link
Member

mtwango commented Jan 19, 2026

This would be better used in if (m_Fight_Targ_UID == pChar->GetUID()) condition.

We only need to clear the actarg1, if this is the target we are canceling the fight with. That would fix the issue with resetting the actarg and properly clearing it when it is the character removed from fight. Something like:

// Go to my next target.
if (m_Fight_Targ_UID == pChar->GetUID()) {
  m_atFight.m_iWarSwingState = WAR_SWING_EQUIPPING;
  m_Fight_Targ_UID.InitUID();
}

@GladieUO
Copy link
Contributor Author

GladieUO commented Jan 19, 2026

This would be better used in if (m_Fight_Targ_UID == pChar->GetUID()) condition.

We only need to clear the actarg1, if this is the target we are canceling the fight with. That would fix the issue with resetting the actarg and properly clearing it when it is the character removed from fight. Something like:

// Go to my next target.
if (m_Fight_Targ_UID == pChar->GetUID()) {
  m_atFight.m_iWarSwingState = WAR_SWING_EQUIPPING;
  m_Fight_Targ_UID.InitUID();
}

Edit: Correction, now I know what you mean, NPC would clear only ACTARG1 of its target, but what if im casting heal / area spell whatever, meanwhile the NPC with target on me dies? It will have same effect, no? Current spell will be interupted.

On my sphere build I extended this condition to not only if im using magic, but also if im pet or ridden. Since there is a long time bug, where if you shrink pet, its ACTARG1 is set to the figurine UID, however im suspicious, that if there is timing badluck, and you shrink pet while the NPC dies, it will somehow override the ACTARG1 too, and after GC or reboot, the NPC is deleted because of missing figurine link.

@mtwango
Copy link
Member

mtwango commented Jan 19, 2026

Edit: Correction, now I know what you mean, NPC would clear only ACTARG1 of its target, but what if im casting heal / area spell whatever, meanwhile the NPC with target on me dies? It will have same effect, no? Current spell will be interupted.

It should be interrupted only when you are casting spell directly on the character.

I haven't tested how the ids rotate when fighting multiple enemies, but this is easily testable when you hit character while casting with invis gm. The GM characters (cast 5 on player) will enter and leave combat since it cant be seen and screw up players target (for example casting light or heal on himself).

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.

2 participants