Skip to content

Commit

Permalink
[MIRROR] Atmos wrench act & small typo fix [MDB IGNORE](#1079)
Browse files Browse the repository at this point in the history
* Atmos wrench act & small typo fix (#80245)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: SyncIt21 <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2023
1 parent 9d186f1 commit 4c1ed95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/// Return when an item interaction is successful.
/// This cancels the rest of the chain entirely and indicates success.
#define ITEM_INTERACT_SUCCESS (1<<0) // Same as TRUE, as most tool (legacy) tool acts return TRUE on success
/// Return to prevent the rest of the attacck chain from being executed / preventing the item user from thwacking the target.
/// Return to prevent the rest of the attack chain from being executed / preventing the item user from thwacking the target.
/// Similar to [ITEM_INTERACT_SUCCESS], but does not necessarily indicate success.
#define ITEM_INTERACT_BLOCKING (1<<1)
/// Return to skip the rest of the interaction chain, going straight to attack.
Expand Down
14 changes: 7 additions & 7 deletions code/modules/atmospherics/machinery/atmosmachinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@

/obj/machinery/atmospherics/wrench_act(mob/living/user, obj/item/I)
if(!can_unwrench(user))
return ..()
return ITEM_INTERACT_BLOCKING

var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
Expand All @@ -396,11 +396,11 @@
var/empty_mixes = 0
for(var/gas_mix_number in 1 to device_type)
var/datum/gas_mixture/gas_mix = all_gas_mixes[gas_mix_number]
if(!(gas_mix.total_moles() > 0))
if(!gas_mix.total_moles())
empty_mixes++
if(empty_mixes == device_type)
empty_pipe = TRUE
if(!(int_air.total_moles() > 0))
if(!int_air.total_moles())
empty_pipe = TRUE

if(!empty_pipe)
Expand All @@ -410,8 +410,7 @@
to_chat(user, span_warning("As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?"))
unsafe_wrenching = TRUE //Oh dear oh dear

var/time_taken = empty_pipe ? 0 : 20
if(I.use_tool(src, user, time_taken, volume = 50))
if(I.use_tool(src, user, empty_pipe ? 0 : 2 SECONDS, volume = 50))
user.visible_message( \
"[user] unfastens \the [src].", \
span_notice("You unfasten \the [src]."), \
Expand All @@ -421,9 +420,10 @@
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
if(unsafe_wrenching)
unsafe_pressure_release(user, internal_pressure)
return deconstruct(TRUE)
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS

return ..()
return ITEM_INTERACT_BLOCKING

/**
* Getter for can_unwrench
Expand Down

0 comments on commit 4c1ed95

Please sign in to comment.