Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

[MIRROR] Fixes admin template uploads #606

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/modules/admin/verbs/map_template_loadverb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
var/datum/map_template/M
switch(alert(src, "What kind of map is this?", "Map type", "Normal", "Shuttle", "Cancel"))
if("Normal")
M = new /datum/map_template(map, "[map]", TRUE)
M = new /datum/map_template(map, "[map] - Uploaded by [ckey] at [time2text(world.timeofday,"YYYY-MM-DD hh:mm:ss")]", TRUE)
if("Shuttle")
M = new /datum/map_template/shuttle(map, "[map]", TRUE)
M = new /datum/map_template/shuttle(map, "[map] - Uploaded by [ckey] at [time2text(world.timeofday,"YYYY-MM-DD hh:mm:ss")]", TRUE)
else
return
if(!M.cached_map)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mapping/reader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@
/datum/parsed_map/New(tfile, x_lower = -INFINITY, x_upper = INFINITY, y_lower = -INFINITY, y_upper=INFINITY, measureOnly=FALSE)
if(isfile(tfile))
original_path = "[tfile]"
var/temp_hack_garbage = tfile
tfile = rustg_file_read(tfile)
//This is hacky garbage
if(tfile == "") //Might be an upload, try raw loading it.
tfile = file2text(temp_hack_garbage)
else if(isnull(tfile))
// create a new datum without loading a map
return
Expand Down