diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-20 09:10:40 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-20 09:10:40 -0700 |
commit | 23c0f35ab70cec236e8026529cbdffb730531454 (patch) | |
tree | 36687eedc6d717401daaefd0e2cd42b2dfe85cf6 /src/map/map.hpp | |
parent | d3beae7c9699033b000def8aeff8cedfe5525f5f (diff) | |
download | tmwa-23c0f35ab70cec236e8026529cbdffb730531454.tar.gz tmwa-23c0f35ab70cec236e8026529cbdffb730531454.tar.bz2 tmwa-23c0f35ab70cec236e8026529cbdffb730531454.tar.xz tmwa-23c0f35ab70cec236e8026529cbdffb730531454.zip |
Refactor npc event timers to have an expired state
This is needed for setnpctimer 0; to work in the ultimate OnTimer#: label.
Diffstat (limited to 'src/map/map.hpp')
-rw-r--r-- | src/map/map.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<const ScriptBuffer> 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<npc_timerevent_list>::iterator nexttimer; + std::vector<npc_timerevent_list>::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<npc_timerevent_list> timer_eventv; + // List of (name, offset) label locations in the bytecode std::vector<npc_label_list> label_listv; } scr; |