Skip to content

Commit

Permalink
[MIRROR] Fixes issues with the paint sprayer (#2792)
Browse files Browse the repository at this point in the history
Co-authored-by: Hubblenaut <[email protected]>
Co-authored-by: Lexanx <[email protected]>
  • Loading branch information
3 people authored Nov 24, 2024
1 parent 9e4d6d0 commit cae64ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 7 additions & 9 deletions code/game/objects/items/devices/paint_sprayer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Monotile halved" = list("path" = /obj/floor_decal/corner/white/half, "colored" = 1),
"Hazard stripes" = list("path" = /obj/floor_decal/industrial/warning/fulltile),
"Border, hazard" = list("path" = /obj/floor_decal/industrial/warning),
"Corner, hazard" = list("path" = /obj/floor_decal/industrial/warning/corner),
"Corner, hazard" = list("path" = /obj/floor_decal/industrial/warning/corner, "precise" = 1),
"Hatched marking" = list("path" = /obj/floor_decal/industrial/hatch, "colored" = 1),
"Dashed outline" = list("path" = /obj/floor_decal/industrial/outline, "colored" = 1),
"Loading sign" = list("path" = /obj/floor_decal/industrial/loading),
Expand Down Expand Up @@ -111,10 +111,9 @@
GLOB.module_deselected_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler))
GLOB.module_deactivated_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler))

/obj/item/device/paint_sprayer/use_before(atom/target, mob/living/user, click_parameters)
/obj/item/device/paint_sprayer/use_after(atom/target, mob/living/user, click_parameters)
if (apply_paint(target, user, click_parameters))
return TRUE

return ..()

/obj/item/device/paint_sprayer/proc/pick_color(atom/A, mob/user)
Expand All @@ -131,12 +130,12 @@
to_chat(user, SPAN_WARNING("\The [A] does not have a color that you could pick from."))
return TRUE // There was an attempt to pick a color.

/obj/item/device/paint_sprayer/proc/apply_paint(atom/A, mob/user, params)
/obj/item/device/paint_sprayer/proc/apply_paint(atom/A, mob/user, click_parameters)
if (A.atom_flags & ATOM_FLAG_CAN_BE_PAINTED)
A.set_color(paint_color)
. = TRUE
else if (istype(A, /turf/simulated/floor))
. = paint_floor(A, user, params)
. = paint_floor(A, user, click_parameters)
else if (istype(A, /obj/machinery/door/airlock))
. = paint_airlock(A, user)
else if (istype(A, /mob/living/exosuit))
Expand Down Expand Up @@ -186,7 +185,7 @@
return FALSE
return picked_color

/obj/item/device/paint_sprayer/proc/paint_floor(turf/simulated/floor/F, mob/user, params)
/obj/item/device/paint_sprayer/proc/paint_floor(turf/simulated/floor/F, mob/user, click_parameters)
if(!F.flooring)
to_chat(user, SPAN_WARNING("You need flooring to paint on."))
return FALSE
Expand Down Expand Up @@ -217,9 +216,8 @@
if(!decal_data["precise"])
painting_dir = user.dir
else
var/list/mouse_control = params2list(params)
var/mouse_x = text2num(mouse_control["icon-x"])
var/mouse_y = text2num(mouse_control["icon-y"])
var/mouse_x = text2num(click_parameters["icon-x"])
var/mouse_y = text2num(click_parameters["icon-y"])
if(isnum(mouse_x) && isnum(mouse_y))
if(mouse_x <= 16)
if(mouse_y <= 16)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@


/mob/living/carbon/swap_hand()
. = ..()
hand = !hand
if(hud_used.l_hand_hud_object && hud_used.r_hand_hud_object)
if(hand) //This being 1 means the left hand is in use
Expand Down

0 comments on commit cae64ca

Please sign in to comment.