if we're changing maps, use SetMap()

This commit is contained in:
onyx-and-iris 2023-11-30 09:44:34 +00:00
parent 7683665c7c
commit fdf83415d4

View File

@ -14,12 +14,15 @@ Function Read-HostUntilEmpty {
if ($line -in @("fast_restart", "map_rotate", "map_restart")) { if ($line -in @("fast_restart", "map_rotate", "map_restart")) {
$cmd = $line -replace '(?:^|_)(\p{L})', { $_.Groups[1].Value.ToUpper() } $cmd = $line -replace '(?:^|_)(\p{L})', { $_.Groups[1].Value.ToUpper() }
$resp = $rcon.$cmd() $rcon.$cmd()
}
elseif ($line.StartsWith("map mp_")) {
$mapname = $line.Split()[1]
$rcon.SetMap($mapname)
} }
else { else {
$resp = $rcon.Send($line) $rcon.Send($line)
} }
$resp | Write-Host
} }
} }