Difference between revisions of "User:DavidJCobb/Stack dumping"

m
imported>DavidJCobb
imported>DavidJCobb
Line 69: Line 69:


=== Process a task OnHit, without outright discarding concurrent calls ===
=== Process a task OnHit, without outright discarding concurrent calls ===
We want to avoid doing processing during concurrent calls, but we may not want to outright discard concurrent calls. If an enemy is hit four times in rapid succession, we'll want to process all four hits, but we'll want to do so in just one stack, if possible. To accomplish this, we block concurrent calls, but we keep track of how many such calls we've blocked; and in a loop, we run our task that number of times.
We want to avoid doing processing during concurrent calls, but we may not want to outright discard concurrent calls. If an enemy is hit four times in rapid succession, we might want to process all four hits, but we'll still want to do our actual processing in just one stack, if possible. To accomplish this, we block concurrent calls, but we keep track of how many such calls we've blocked; and in a loop, we run our task that number of times.


<source lang="Papyrus">
<source lang="Papyrus">
Anonymous user