Fixes Improper usage of tool_use_check proc (#18362)

* fix

* better implementation
This commit is contained in:
Sirryan2002
2022-07-13 19:22:45 -04:00
committed by GitHub
parent f9b2a2b67e
commit dcb4d43e5c
3 changed files with 7 additions and 5 deletions
@@ -43,7 +43,7 @@
return tool_use_check(user, amount)
// A check called by tool_start_check once, and by use_tool on every tick of delay.
/obj/item/proc/tool_use_check(mob/living/user, amount)
/obj/item/proc/tool_use_check(mob/living/user, amount, silent = FALSE)
return !amount
/obj/item/proc/play_tool_sound(atom/target, volume = tool_volume)
+5 -3
View File
@@ -107,14 +107,16 @@
M.update_inv_l_hand()
// If welding tool ran out of fuel during a construction task, construction fails.
/obj/item/weldingtool/tool_use_check(mob/living/user, amount)
/obj/item/weldingtool/tool_use_check(mob/living/user, amount, silent = FALSE)
if(!tool_enabled)
to_chat(user, "<span class='notice'>[src] has to be on to complete this task!</span>")
if(!silent)
to_chat(user, "<span class='notice'>[src] has to be on to complete this task!</span>")
return FALSE
if(GET_FUEL >= amount * requires_fuel)
return TRUE
else
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
if(!silent)
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
return FALSE
// When welding is about to start, run a normal tool_use_check, then flash a mob if it succeeds.