From c68c0fb6d54d59867d1fb23069f965cf487e4dc2 Mon Sep 17 00:00:00 2001 From: kane-f <57303506+kane-f@users.noreply.github.com> Date: Mon, 19 Apr 2021 09:50:54 +0100 Subject: [PATCH] Removes "/" from ends of map names in voting options (#29235) * Attempt at fixing map names * Proper attempt * Fixing redundant string trim Co-authored-by: kanef --- code/__HELPERS/files.dm | 4 ++-- code/game/gamemodes/gameticker.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index ee43ab6da0d..ead413f751f 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -64,7 +64,7 @@ if(skipping < 3) var/fullpath = path+binary if(copytext(fullpath,-4,0) == ".dmb") - all_maps[potential] = path + binary + all_maps[copytext(potential,1,length(potential))] = path + binary // Makes key not have / at end, looks better in lists else binary = null continue @@ -103,7 +103,7 @@ if(!binary) warning("Map folder [path] does not contain a valid byond binary, skipping.") else - maps[potential] = path + binary + maps[copytext(potential,1,length(potential))] = path + binary // Makes key not have / at end, looks better in lists binary = null recursion_limit-- var/list/maplist = get_list_of_keys(maps) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index be99e21b8d2..01c063c7684 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -471,7 +471,7 @@ var/datum/controller/gameticker/ticker choices.Add(key) var/mapname=pick(choices) vote.chosen_map = maps[mapname] // Hack, but at this point I could not give a shit. - watchdog.chosen_map = copytext(mapname,1,(length(mapname))) + watchdog.chosen_map = mapname log_game("Server chose [watchdog.chosen_map]!")