diff --git a/code/modules/surgery/surgery_helpers.dm b/code/modules/surgery/surgery_helpers.dm index ec33b47dca2..00beb0de449 100644 --- a/code/modules/surgery/surgery_helpers.dm +++ b/code/modules/surgery/surgery_helpers.dm @@ -1,15 +1,18 @@ +/* + * Gets the surgery speed modifier for a given mob, based off what sort of table/bed/whatever is on their turf. + */ /proc/get_location_modifier(mob/located_mob) - var/turf/mob_turf = get_turf(located_mob) - if(locate(/obj/structure/table/optable, mob_turf)) - return 1 - else if(locate(/obj/machinery/stasis, mob_turf)) - return 0.9 - else if(locate(/obj/structure/table, mob_turf)) - return 0.8 - else if(locate(/obj/structure/bed, mob_turf)) - return 0.7 - else - return 0.5 + // Technically this IS a typecache, just not the usual kind :3 + var/static/list/modifiers = zebra_typecacheof(list( + /obj/structure/table = 0.8, + /obj/structure/table/optable = 1, + /obj/structure/table/optable/abductor = 1.2, + /obj/machinery/stasis = 0.9, + /obj/structure/bed = 0.7, + )) + . = 0.5 + for(var/obj/thingy in get_turf(located_mob)) + . = max(., modifiers[thingy.type]) /proc/get_location_accessible(mob/located_mob, location)