Two new command automation events

- "QueueStart"
    - Activates just before RoundStart, but only if a roundqueue is being started
- "QueueEnd"
    - Activates just before IntermissionStart, but only if the roundqueue has just finished its final map
I chose before in both instances because Automate_Run runs off COM_BufAddText, and I don't completely trust that the buffer won't overflow for particularly complicated server commands, so prioritising the rarer event. However, this is open for discussion
This commit is contained in:
toaster 2023-05-03 22:08:13 +01:00
parent 99a1e47487
commit b72bc73d28
4 changed files with 15 additions and 1 deletions

View file

@ -592,7 +592,9 @@ const char *automate_names[AEV__MAX] =
{
"RoundStart", // AEV_ROUNDSTART
"IntermissionStart", // AEV_INTERMISSIONSTART
"VoteStart" // AEV_VOTESTART
"VoteStart", // AEV_VOTESTART
"QueueStart", // AEV_QUEUESTART
"QueueEnd", // AEV_QUEUEEND
};
UINT32 livestudioaudience_timer = 90;

View file

@ -276,6 +276,8 @@ typedef enum
AEV_ROUNDSTART,
AEV_INTERMISSIONSTART,
AEV_VOTESTART,
AEV_QUEUESTART,
AEV_QUEUEEND,
AEV__MAX
} automateEvents_t;

View file

@ -1598,6 +1598,11 @@ void G_DoLoadLevelEx(boolean resetplayer, gamestate_t newstate)
if (doAutomate == true)
{
if (roundqueue.size > 0 && roundqueue.position == 1)
{
Automate_Run(AEV_QUEUESTART);
}
Automate_Run(AEV_ROUNDSTART);
}

View file

@ -849,6 +849,11 @@ void Y_StartIntermission(void)
K_CashInPowerLevels();
}
if (roundqueue.size > 0 && roundqueue.position == roundqueue.size)
{
Automate_Run(AEV_QUEUEEND);
}
Automate_Run(AEV_INTERMISSIONSTART);
bgpatch = W_CachePatchName("MENUBG", PU_STATIC);
widebgpatch = W_CachePatchName("WEIRDRES", PU_STATIC);