Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brain-dawg committed Feb 25, 2025
1 parent 246e0e3 commit 0e20382
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions mge/functions.nut
Original file line number Diff line number Diff line change
Expand Up @@ -1459,21 +1459,25 @@
{
local end = arena.SpawnPoints.len() - 1

//if koth_cap is not set in the mge config, KOTH uses the last index for the cap zone
if (arena.IsKoth && !("koth_cap" in arena) && !arena.IsCustomRuleset)
end--

local idx = arena.SpawnIdx

local team = player.GetTeam()
//halve the end point for red (first half of the spawn points)
if (team == TF_TEAM_RED)
end /= 2

//add half the current index for blue (second half of the spawn points)
if (team == TF_TEAM_BLUE)
idx += (end / 2)

idx = (idx + 1) % end
arena.SpawnIdx = idx

printl(Convars.GetClientConvarValue("name", player.entindex()) + " :\n " + player.GetTeam() + " :\n " + idx)
return idx
}

Expand Down
5 changes: 2 additions & 3 deletions mge/mge.nut
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ timer_scope.InputSetTime <- function() {

}
timer_scope.Inputsettime <- timer_scope.InputSetTime
timer_scope.hinted <- false

timer_scope.TimerThink <- function()
{
Expand Down Expand Up @@ -794,17 +795,15 @@ timer_scope.TimerThink <- function()
}
}

local hinted = false
// Show countdown message in last minute
if (time_left < 60 && !(time_left.tointeger() % 10))
{
if (!hinted)
{
SendGlobalGameEvent("player_hintmessage", {hintmessage = format("MAP RESTART IN %d SECONDS", time_left.tointeger())})
hinted = true
EntFireByHandle(self, "RunScriptCode", "self.GetScriptScope().hinted = false", 1.1, null, null)
}
} else {
hinted = false
}


Expand Down

0 comments on commit 0e20382

Please sign in to comment.