Fixes this properly.

This commit is contained in:
AnturK
2019-06-18 22:46:16 +02:00
parent c2bc6164c7
commit 1a18086a3b
+13 -1
View File
@@ -103,8 +103,20 @@
switch(action)
if("load_program")
var/program_to_load = text2path(params["type"])
if(!ispath(program_to_load) || !(program_to_load in program_cache || program_to_load in emag_programs))
if(!ispath(program_to_load))
return FALSE
var/valid = FALSE
var/list/checked = program_cache
if(obj_flags & EMAGGED)
checked |= emag_programs
for(var/prog in checked)
var/list/P = prog
if(P["type"] == program_to_load)
valid = TRUE
break
if(!valid)
return FALSE
var/area/A = locate(program_to_load) in GLOB.sortedAreas
if(A)
load_program(A)