mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
Fixes Improper usage of tool_use_check proc (#18362)
* fix * better implementation
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user