Skip to content

Commit a120b0f

Browse files
MarsM0ndMarsMond
andauthored
Scrubbing fix (#7152)
Co-authored-by: MarsMond <no@email>
1 parent 011e27a commit a120b0f

File tree

1 file changed

+15
-46
lines changed
  • code/modules/mob/living/silicon/robot

1 file changed

+15
-46
lines changed

code/modules/mob/living/silicon/robot/robot.dm

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,11 @@
11121112
/mob/living/silicon/robot/Moved()
11131113
. = ..()
11141114
if(module)
1115-
if(module.type == /obj/item/robot_module/robot/janitor)
1115+
if(module.type == /obj/item/robot_module/robot/janitor || scrubbing)
11161116
var/turf/tile = loc
1117-
if(isturf(tile))
1117+
var/datum/matter_synth/water = water_res
1118+
if(isturf(tile) && ((!scrubbing) || (water && water.use_charge(1))))
1119+
//Got a tile to clean, and we use the simple logic, or we check and use water
11181120
tile.clean_blood()
11191121
if (istype(tile, /turf/simulated))
11201122
var/turf/simulated/S = tile
@@ -1144,50 +1146,17 @@
11441146
cleaned_human.clean_blood(1)
11451147
to_chat(cleaned_human, "<font color='red'>[src] cleans your face!</font>")
11461148

1147-
if(istype(module_state_1, /obj/item/storage/bag/ore) || istype(module_state_2, /obj/item/storage/bag/ore) || istype(module_state_3, /obj/item/storage/bag/ore)) //Borgs and drones can use their mining bags ~automagically~ if they're deployed in a slot. Only mining bags, as they're optimized for mass use.
1148-
var/obj/item/storage/bag/ore/B = null
1149-
if(istype(module_state_1, /obj/item/storage/bag/ore)) //First orebag has priority, if they for some reason have multiple.
1150-
B = module_state_1
1151-
else if(istype(module_state_2, /obj/item/storage/bag/ore))
1152-
B = module_state_2
1153-
else if(istype(module_state_3, /obj/item/storage/bag/ore))
1154-
B = module_state_3
1155-
var/turf/tile = loc
1156-
if(isturf(tile))
1157-
B.obj_storage.interacted_mass_pickup(new /datum/event_args/actor(src), tile)
1158-
return
1159-
1160-
if(scrubbing)
1161-
var/datum/matter_synth/water = water_res
1162-
if(water && water.energy >= 1)
1163-
var/turf/tile = loc
1164-
if(isturf(tile))
1165-
water.use_charge(1)
1166-
tile.clean_blood()
1167-
if(istype(tile, /turf/simulated))
1168-
var/turf/simulated/T = tile
1169-
T.dirt = 0
1170-
for(var/A in tile)
1171-
if(istype(A,/obj/effect/rune) || istype(A,/obj/effect/debris/cleanable) || istype(A,/obj/effect/overlay))
1172-
qdel(A)
1173-
else if(istype(A, /mob/living/carbon/human))
1174-
var/mob/living/carbon/human/cleaned_human = A
1175-
if(cleaned_human.lying)
1176-
if(cleaned_human.head)
1177-
cleaned_human.head.clean_blood()
1178-
cleaned_human.update_inv_head(0)
1179-
if(cleaned_human.wear_suit)
1180-
cleaned_human.wear_suit.clean_blood()
1181-
cleaned_human.update_inv_wear_suit(0)
1182-
else if(cleaned_human.w_uniform)
1183-
cleaned_human.w_uniform.clean_blood()
1184-
cleaned_human.update_inv_w_uniform(0)
1185-
if(cleaned_human.shoes)
1186-
cleaned_human.shoes.clean_blood()
1187-
cleaned_human.update_inv_shoes(0)
1188-
cleaned_human.clean_blood(1)
1189-
to_chat(cleaned_human, "<span class='warning'>[src] cleans your face!</span>")
1190-
return
1149+
//Borgs and drones can use their mining bags ~automagically~ if they're deployed in a slot. Only mining bags, as they're optimized for mass use.
1150+
var/obj/item/storage/bag/ore/B = null
1151+
if(istype(module_state_1, /obj/item/storage/bag/ore)) //First orebag has priority, if they for some reason have multiple.
1152+
B = module_state_1
1153+
else if(istype(module_state_2, /obj/item/storage/bag/ore))
1154+
B = module_state_2
1155+
else if(istype(module_state_3, /obj/item/storage/bag/ore))
1156+
B = module_state_3
1157+
var/turf/tile = loc
1158+
if(B && isturf(tile))
1159+
B.obj_storage.interacted_mass_pickup(new /datum/event_args/actor(src), tile)
11911160

11921161
/mob/living/silicon/robot/proc/self_destruct()
11931162
gib()

0 commit comments

Comments
 (0)