From 23c0f35ab70cec236e8026529cbdffb730531454 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 20 Aug 2013 09:10:40 -0700 Subject: Refactor npc event timers to have an expired state This is needed for setnpctimer 0; to work in the ultimate OnTimer#: label. --- src/map/map.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/map/map.hpp') diff --git a/src/map/map.hpp b/src/map/map.hpp index 87bf1f9..d98900d 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -359,6 +359,9 @@ public: std::unique_ptr script; // Diameter. short xs, ys; + + // Whether the timer advances if not beyond end. + bool timer_active; // Tick counter through the timers. // It is actually updated when frobbing the thing in any way. // If this is timer_eventv().back().timer, it is expired @@ -367,11 +370,12 @@ public: // Actual timer that fires the event. Timer timerid; // Event to be fired, or .end() if no timer. - std::vector::iterator nexttimer; + std::vector::iterator next_event; // When the timer started. Needed to get the true diff, or to stop. tick_t timertick; // List of label events to call. std::vector timer_eventv; + // List of (name, offset) label locations in the bytecode std::vector label_listv; } scr; -- cgit v1.2.3-60-g2f50