+ AO_TICK_TYPE delay_done;
+ AO_TICK_SIGNED delay = pyro->delay;
+ if (delay < 0)
+ delay = 0;
+ delay_done = ao_time() + (AO_TICK_TYPE) delay;
+
+ /*
+ * delay_done is the time at which the
+ * delay ends, but it is also used as
+ * an indication that a delay is
+ * active -- non-zero values indicate
+ * an active delay. This code ensures
+ * the value is non-zero, which might
+ * introduce an additional tick
+ * of delay.
+ */
+ if (delay_done == 0)
+ delay_done = 1;
+ pyro_delay_done[p] = delay_done;