diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index b62f32c2da9..7343787a25c 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -14,10 +14,10 @@ return A /proc/get_area(atom/A) - if(!istype(A)) - return - for(A, A && !isarea(A), A=A.loc); //semicolon is for the empty statement - return A + if(isarea(A)) + return A + var/turf/T = get_turf(A) + return T ? T.loc : null /proc/get_area_name(N) //get area by its name for(var/area/A in world) @@ -518,4 +518,4 @@ proc/pollCandidates(Question, be_special_type, antag_age_check = 0, poll_time = C = M.client if(!C || !C.prefs.windowflashing) return - winset(C, "mainwindow", "flash=5") \ No newline at end of file + winset(C, "mainwindow", "flash=5")