Merge pull request #24114 from Cyberboss/addtimerflag

Adds option of unique timers ignoring wait
This commit is contained in:
oranges
2017-02-17 14:32:12 +13:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -64,3 +64,6 @@
#define TIMER_CLIENT_TIME 0x4
//Timer can be stopped using deltimer()
#define TIMER_STOPPABLE 0x8
//To be used with TIMER_UNIQUE
//prevents distinguishing identical timers with the wait variable
#define TIMER_NO_HASH_WAIT 0x10
+5 -1
View File
@@ -298,7 +298,11 @@ proc/addtimer(datum/callback/callback, wait, flags)
var/hash
if (flags & TIMER_UNIQUE)
var/list/hashlist = list(callback.object, "(\ref[callback.object])", callback.delegate, wait, flags & TIMER_CLIENT_TIME)
var/list/hashlist
if(flags & TIMER_NO_HASH_WAIT)
hashlist = list(callback.object, "(\ref[callback.object])", callback.delegate, flags & TIMER_CLIENT_TIME)
else
hashlist = list(callback.object, "(\ref[callback.object])", callback.delegate, wait, flags & TIMER_CLIENT_TIME)
hashlist += callback.arguments
hash = hashlist.Join("|||||||")