Skip to content

Fix stale ground skill tick cache after mob respawn#3418

Merged
hemagx merged 1 commit into
HerculesWS:masterfrom
AcidMarco:fix-ground-skill-tick-cache
Jul 15, 2026
Merged

Fix stale ground skill tick cache after mob respawn#3418
hemagx merged 1 commit into
HerculesWS:masterfrom
AcidMarco:fix-ground-skill-tick-cache

Conversation

@AcidMarco

Copy link
Copy Markdown
Contributor

Pull Request Prelude

  • I have followed [proper Hercules code styling][code].
  • I have read and understood the [contribution guidelines][cont] before making this PR.
  • I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

This fixes a long-uptime ground skill issue where per-target ground skill tick entries could incorrectly suppress later skill effects.

Ground skill processing stores per-target tick entries in unit_data.skillunittick. For skills with UF_NOOVERLAP, the stored entry is keyed by skill_id. Since natural mob respawn reuses mob_data / unit_data, old entries can survive into the next life.

The tick comparison in skill_unit_onplace_timer() used DIFF_TICK32(), while timer ticks are int64. After long uptime, an old stored tick can wrap through the 32-bit comparison and be treated as if it were still in the future, causing the ground skill effect to be skipped.

This PR:

  • uses DIFF_TICK() with an int64 diff for ground skill tick checks;
  • clears skillunittick[] when a mob is scheduled for natural respawn.

Issues addressed: Fixes #3417

Ground skill tick checks used DIFF_TICK32() even though timer ticks are int64. After long map-server uptime this could make an old per-target tick entry look like a future tick and skip the ground skill effect.

Natural mob respawn reuses mob_data/unit_data, so clear skillunittick for the next life to avoid carrying per-target ground skill state across deaths.

Fixes HerculesWS#3417.
@hemagx

hemagx commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thank you for your first contribution!

@hemagx hemagx added this to the Release v2026.07 milestone Jul 15, 2026
@hemagx
hemagx merged commit cd6e094 into HerculesWS:master Jul 15, 2026
97 checks passed
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