diff --git a/code/game/objects/items/weapons/powerfist.dm b/code/game/objects/items/weapons/powerfist.dm index 5b8a6f90fd0..83ac2e942cc 100644 --- a/code/game/objects/items/weapons/powerfist.dm +++ b/code/game/objects/items/weapons/powerfist.dm @@ -89,7 +89,7 @@ if(!tank) to_chat(user, "[src] can't operate without a source of gas!") return - if(tank && !tank.air_contents.remove(gasperfist * fisto_setting)) + if(tank && !tank.air_contents.boolean_remove(gasperfist * fisto_setting)) to_chat(user, "[src]'s piston-ram lets out a weak hiss, it needs more gas!") playsound(loc, 'sound/effects/refill.ogg', 50, 1) return diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 2310e116872..3f62b0cdd37 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -111,6 +111,12 @@ What are the archived variables for? return TRUE + /// Only removes the gas if we have more than the amount +/datum/gas_mixture/proc/boolean_remove(amount) + if(amount > total_moles()) + return FALSE + return remove(amount) + ///Proportionally removes amount of gas from the gas_mixture. ///Returns: gas_mixture with the gases removed /datum/gas_mixture/proc/remove(amount)