Corrects surgery surface logic.

This commit is contained in:
MistakeNot4892
2023-06-05 15:01:51 +10:00
parent 1e92c0240c
commit 9ce1d4dee5
+6 -7
View File
@@ -1172,14 +1172,13 @@ var/global/list/common_tools = list(
// Returns an instance of a valid surgery surface.
/mob/living/proc/get_surgery_surface(mob/living/user)
if(!lying && user != src)
return null // Not lying down means no surface.
var/obj/surface = null
for(var/obj/O in loc) // Looks for the best surface.
if(O.surgery_odds)
if(!surface || surface.surgery_odds < O)
// Not lying down means no surface.
if(lying || user == src)
// Looks for the best surface.
var/obj/surface
for(var/obj/O in loc)
if(!surface || surface.surgery_odds < O.surgery_odds)
surface = O
if(surface)
return surface
/proc/reverse_direction(var/dir)