}
}
-/**
- * Checks whether the server initiated a map restart (stat_game_starttime changed)
- *
- * TODO: Use a better solution where a common shared entitiy is used that contains
- * timelimit, fraglimit and game_starttime! Requires engine changes (remove STAT_TIMELIMIT
- * and STAT_FRAGLIMIT to be auto-sent)
- */
-void CheckForGamestartChange() {
- float startTime;
- startTime = getstatf(STAT_GAMESTARTTIME);
- if (previous_game_starttime != startTime) {
- if ((time + 5.0) < startTime) {
- //if connecting to server while restart was active don't always play prepareforbattle
- sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
- }
- if (time < startTime) {
- restartAnnouncer = spawn();
- restartAnnouncer.think = restartAnnouncer_Think;
- restartAnnouncer.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
- }
- }
- previous_game_starttime = startTime;
-}
-
void Porto_Init()
{
porto = spawn();
PostInit();
if(intermission && !isdemo() && !(calledhooks & HOOK_END))
+ {
if(calledhooks & HOOK_START)
{
localcmd("\ncl_hook_gameend\n");
calledhooks |= HOOK_END;
}
-
- CheckForGamestartChange();
- serverAnnouncer();
- maptimeAnnouncer();
- carrierAnnouncer();
+ }
+
+ Announcer();
fov = autocvar_fov;
if(fov <= 59.5)