Skip to content

Commit

Permalink
h
Browse files Browse the repository at this point in the history
  • Loading branch information
Brain-dawg committed Jan 26, 2025
1 parent aabb1d5 commit 8be10fb
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions mge/functions.nut
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

//passing a specific arena will refresh the rulesets temporarily for use in !rulesets
//it does NOT initialize anything, only modifies the existing data

//passing an arena name and setting arena_reset to true will convert the existing arena to a standard MGE arena
::LoadSpawnPoints <- function(custom_ruleset_arena_name = null, arena_reset = false)
{
Expand Down Expand Up @@ -416,7 +416,7 @@
local stat_index = this._current_stat_index

local stat = stat_keys[stat_index in stat_keys ? stat_index : 0]

// printl("populating leaderboard")

local column_name = ""
Expand Down Expand Up @@ -465,18 +465,18 @@
} else {
think_override = LEADERBOARD_UPDATE_INTERVAL
}

// foreach( u in user_info)
// printl(u)
local name = 2 in user_info && user_info[2] ? user_info[2] : user_info[0]
message += format("\n %d | %s | %d\n", i + 1, name.tostring(), user_info[1])
}
MGE_Leaderboard.KeyValueFromString("message", message)

this._current_stat_index++
yield
}

// Reset index and refresh data when done with all stats
this._current_stat_index = 0
}
Expand All @@ -497,9 +497,7 @@
local idx_failed = false
foreach(arena_name, _arena in config)
{
if (arena_reset && arena_name != custom_ruleset_arena_name) continue

if (arena_reset)
if (arena_reset && arena_name == custom_ruleset_arena_name)
{
_arena.mge <- "1"
_arena.IsMGE <- true
Expand All @@ -508,7 +506,8 @@
foreach(k, v in special_arenas)
{
if (k in _arena)
_arena[k] = "0"
delete _arena[k]
// _arena[k] = "0"

_arena.RulesetVote[k] <- array(2, false)
}
Expand Down Expand Up @@ -2177,7 +2176,7 @@
point.KeyValueFromVector("origin", point_trace.pos + Vector(0, 0, 10))
local normal_angles = VectorAngles(point_trace.plane_normal)
point.SetAbsAngles(QAngle(normal_angles.x, normal_angles.y, normal_angles.z) + QAngle(90, 0, 0))

scope.point_cooldown <- 0.0

function CanPlacePoint() {
Expand All @@ -2196,7 +2195,7 @@

return true
}

//place point
if (CanPlacePoint())
{
Expand All @@ -2218,7 +2217,7 @@
foreach(p, _ in arena.CurrentPlayers)
if (scope.temp_point)
EntFireByHandle(scope.temp_point, "Kill", "", -1, null, null)

LoadSpawnPoints(arena_name)

arena.RulesetVote.clear()
Expand All @@ -2230,7 +2229,7 @@

if ("CustomRulesetThink" in scope.ThinkTable)
delete scope.ThinkTable.CustomRulesetThink

p.RemoveCustomAttribute("no_attack")
p.RemoveCustomAttribute("disable weapon switch")
}
Expand Down Expand Up @@ -2268,7 +2267,7 @@
p.AddCustomAttribute("no_attack", 1, -1)
p.AddCustomAttribute("disable weapon switch", 1, -1)
}

SetArenaState(arena_name, AS_COUNTDOWN)
return
}

0 comments on commit 8be10fb

Please sign in to comment.