The Method Existed but Was Never Called
Written later and filed to this date, as part of filling in every day of the year.
Track total damage dealt across all damage sources
Implements the three TODO comments in GameScene.ts that passed hardcoded 0 for damageDealt in run statistics sent to AchievementManager and CodexManager.
Three lines in my survivor shooter’s main scene, each reading 0, // TODO: track total damage dealt, at the three places a finished run reports itself: victory, defeat, and the codex that keeps lifetime totals. A session on a Sunday evening in March, on a branch named for exactly this kind of job, added a counter to the scene and fed it from four places: weapon hits through a callback that already existed, projectile hits and overkill splash through a new one, burn and poison through another, thorns inline where the reflected damage is applied. Forty-four lines in. The counter reset at the start of a run and reached both managers at the end of one. I merged it on the Monday.
Fourteen hours after the first commit, a second session on the same kind of branch:
Wire AchievementManager.recordDamageDealt() to all damage sources
The method existed but was never called, causing runStats.damageDealt and runStats.criticalHits to always be 0. This meant lifetime totalDamageDealt and totalCriticalHits were never accumulated, and damage_dealt/crits milestone checks never fired.
The achievement manager had carried its own recorder since the repository’s first day, with a flag for critical hits, feeding a running count that milestone checks read during the run, not after it. The first session’s fix delivered a correct total to the manager at the end of the run, in the field that had asked for it. The milestones never looked at that field. They read the count the recorder fills, and the recorder had no callers. So after the first commit the summary screen was right and the milestone for damage dealt was still, for every player, unreachable.
The second diff is the first diff with one more line at each of the same five sites, plus a boolean threaded through the weapon callback’s signature so that a critical hit arrives as one. It is a tidy fix, and its body is the kind I want: the symptom, always zero; the consequence, milestones never fired; the mechanism, never called.
What the first author understood was the TODO, and it did what a TODO asks. What it could not see from the TODO was that the placeholder sat in one consumer of the number and the number had two. A search for the literal zero found three lines. A search for the statistic’s name would have found a public method with no callers, which is a louder kind of zero, and a quieter one, because nothing marks it. The stat had been wrong in two places since January. One wrong place had a comment on it, so it got fixed first.
The recorder had existed for sixty-eight days before anything called it.