Add flag that always forces the timer to the end of the list

This commit is contained in:
NepDisk 2026-02-13 23:37:35 -05:00
parent d2ddf2a27a
commit e9cdbf97c3
3 changed files with 25 additions and 15 deletions

View file

@ -1825,6 +1825,7 @@ struct int_const_s const INT_CONST[] = {
// item timer stuff
{"TIMER_COUNTER", TIMER_COUNTER},
{"TIMER_NONUMBER",TIMER_NONUMBER},
{"TIMER_END", TIMER_END},
{"TIMER_PURPLE", TIMER_PURPLE},
{"TIMER_YELLOW", TIMER_YELLOW},
{"TIMER_GREEN", TIMER_GREEN},

View file

@ -51,6 +51,14 @@ typedef struct itimer_s
static bool sorttimers(itimer_t a, itimer_t b)
{
const bool enda = (a.flags & TIMER_END);
const bool endb = (b.flags & TIMER_END);
// Check if timer should always be at the end?
if (enda != endb)
return !enda;
// Just sort by time please.
return a.timer < b.timer;
}

View file

@ -26,21 +26,22 @@ typedef enum timerflags_e
{
TIMER_COUNTER = 1,
TIMER_NONUMBER = 1<<1,
TIMER_PURPLE = 1<<2,
TIMER_YELLOW = 1<<3,
TIMER_GREEN = 1<<4,
TIMER_BLUE = 1<<5,
TIMER_RED = 1<<6,
TIMER_GRAY = 1<<7,
TIMER_ORANGE = 1<<8,
TIMER_SKY = 1<<9,
TIMER_LAVENDER = 1<<10,
TIMER_GOLD = 1<<11,
TIMER_AQUA = 1<<12,
TIMER_MAGENTA = 1<<13,
TIMER_PINK = 1<<14,
TIMER_BROWN = 1<<15,
TIMER_TAN = 1<<16,
TIMER_END = 1<<2,
TIMER_PURPLE = 1<<3,
TIMER_YELLOW = 1<<4,
TIMER_GREEN = 1<<5,
TIMER_BLUE = 1<<6,
TIMER_RED = 1<<7,
TIMER_GRAY = 1<<8,
TIMER_ORANGE = 1<<9,
TIMER_SKY = 1<<10,
TIMER_LAVENDER = 1<<11,
TIMER_GOLD = 1<<12,
TIMER_AQUA = 1<<13,
TIMER_MAGENTA = 1<<14,
TIMER_PINK = 1<<15,
TIMER_BROWN = 1<<16,
TIMER_TAN = 1<<17,
} timerflags_t;
extern consvar_t cv_itemtimers;