mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-16 13:12:22 +00:00
Merge pull request #8737 from Spookerton/spkrtn/fix/type2parent-correction
fix || in type2parent switch, gentle refactor
This commit is contained in:
@@ -349,21 +349,22 @@
|
|||||||
last_found = found + delim_len
|
last_found = found + delim_len
|
||||||
while (found)
|
while (found)
|
||||||
|
|
||||||
|
|
||||||
/proc/type2parent(child)
|
/proc/type2parent(child)
|
||||||
var/string_type = "[child]"
|
var/string_type = "[child]"
|
||||||
var/last_slash = findlasttext(string_type, "/")
|
var/last_slash = findlasttext(string_type, "/")
|
||||||
if(last_slash == 1)
|
if (last_slash != 1)
|
||||||
|
return text2path(copytext(string_type, 1, last_slash))
|
||||||
switch (child)
|
switch (child)
|
||||||
if (/datum)
|
if (/datum)
|
||||||
return null
|
return null
|
||||||
if(/obj || /mob)
|
if (/obj, /mob)
|
||||||
return /atom/movable
|
return /atom/movable
|
||||||
if(/area || /turf)
|
if (/area, /turf)
|
||||||
return /atom
|
return /atom
|
||||||
else
|
else
|
||||||
return /datum
|
return /datum
|
||||||
|
|
||||||
return text2path(copytext(string_type, 1, last_slash))
|
|
||||||
|
|
||||||
//checks if a file exists and contains text
|
//checks if a file exists and contains text
|
||||||
//returns text as a string if these conditions are met
|
//returns text as a string if these conditions are met
|
||||||
|
|||||||
Reference in New Issue
Block a user