evaluate_on_win uses .last() — drops all but the final GameWonEvent when multiple fire in one frame #29
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File
solitaire_engine/src/achievement_plugin.rsline 165Description
wins.read().last()only processes the finalGameWonEventper frame. If multiple events arrive (e.g. integration tests, replaying quickly), earlier wins in the same frame skip achievement evaluation entirely. This is inconsistent withprogress_plugin.rs:award_xp_on_win, which correctly iteratesfor ev in wins.read().Fix
Change to
for ev in wins.read() { ... }to handle every win event, matching the pattern inprogress_plugin.rs.