Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Fixes division by zero (tgstation#50800)
Browse files Browse the repository at this point in the history
  • Loading branch information
haukeschuemann authored May 2, 2020
1 parent c8075c1 commit 7103134
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/modules/surgery/organs/lungs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
var/safe_co2_min = 0
var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
var/safe_toxins_min = 0
///How much breath partial pressure is a safe amount of toxins. 0 means that we are immune to toxins.
var/safe_toxins_max = 0.05
var/SA_para_min = 1 //Sleeping agent
var/SA_sleep_min = 5 //Sleeping agent
Expand Down Expand Up @@ -248,7 +249,7 @@
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "chemical_euphoria", /datum/mood_event/chemical_euphoria)
else
SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria")
if(SA_pp > safe_toxins_max*3)
if(safe_toxins_max && SA_pp > safe_toxins_max*3)
var/ratio = (breath_gases[/datum/gas/nitrous_oxide][MOLES]/safe_toxins_max)
H.apply_damage_type(clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
Expand Down

0 comments on commit 7103134

Please sign in to comment.