mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
Merge pull request #47189 from nemvar/fixessurgeryduplicate
Gets rid of duplicate code and fixes surgery start runtime.
This commit is contained in:
@@ -66,23 +66,25 @@
|
||||
return TRUE
|
||||
|
||||
var/turf/T = get_turf(patient)
|
||||
var/obj/structure/table/optable/table = locate(/obj/structure/table/optable, T)
|
||||
if(table)
|
||||
if(table.computer.stat & (NOPOWER|BROKEN))
|
||||
return .
|
||||
if(replaced_by in table.computer.advanced_surgeries)
|
||||
return FALSE
|
||||
if(type in table.computer.advanced_surgeries)
|
||||
return TRUE
|
||||
|
||||
var/obj/machinery/stasis/the_stasis_bed = locate(/obj/machinery/stasis, T)
|
||||
if(the_stasis_bed?.op_computer)
|
||||
if(the_stasis_bed.op_computer.stat & (NOPOWER|BROKEN))
|
||||
return .
|
||||
if(replaced_by in the_stasis_bed.op_computer.advanced_surgeries)
|
||||
return FALSE
|
||||
if(type in the_stasis_bed.op_computer.advanced_surgeries)
|
||||
return TRUE
|
||||
//Get the relevant operating computer
|
||||
var/obj/machinery/computer/operating/opcomputer
|
||||
var/obj/structure/table/optable/table = locate(/obj/structure/table/optable, T)
|
||||
if(table?.computer)
|
||||
opcomputer = table.computer
|
||||
else
|
||||
var/obj/machinery/stasis/the_stasis_bed = locate(/obj/machinery/stasis, T)
|
||||
if(the_stasis_bed?.op_computer)
|
||||
opcomputer = the_stasis_bed.op_computer
|
||||
|
||||
if(!opcomputer)
|
||||
return
|
||||
if(opcomputer.stat & (NOPOWER|BROKEN))
|
||||
return .
|
||||
if(replaced_by in opcomputer.advanced_surgeries)
|
||||
return FALSE
|
||||
if(type in opcomputer.advanced_surgeries)
|
||||
return TRUE
|
||||
|
||||
/datum/surgery/proc/next_step(mob/user, intent)
|
||||
if(location != user.zone_selected)
|
||||
|
||||
Reference in New Issue
Block a user