Warning System Fix

- This fixes bugged powernet warning system. Electrocution now properly triggers warning even when short-circuit is caused by gloved user
- However, there is small difference. Causing sparks but not taking damage triggers only 5 tick warning, instead of 20 tick one. 20 tick warning is triggered when injury is caused.
This commit is contained in:
Atlantiscze
2015-01-01 06:00:05 +01:00
parent 35b42c47c5
commit 6bd47590cd

View File

@@ -307,13 +307,6 @@
//No animations will be performed by this proc.
/proc/electrocute_mob(mob/living/carbon/M as mob, var/power_source, var/obj/source, var/siemens_coeff = 1.0)
if(istype(M.loc,/obj/mecha)) return 0 //feckin mechs are dumb
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.species.siemens_coefficient == 0)
return
if(H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.siemens_coefficient == 0) return 0 //to avoid spamming with insulated glvoes on
var/area/source_area
if(istype(power_source,/area))
source_area = power_source
@@ -339,6 +332,23 @@
else
log_admin("ERROR: /proc/electrocute_mob([M], [power_source], [source]): wrong power_source")
return 0
//Triggers powernet warning, but only for 5 ticks (if applicable)
//If following checks determine user is protected we won't alarm for long.
if(PN)
PN.trigger_warning(5)
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.species.siemens_coefficient == 0)
return
if(H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.siemens_coefficient == 0) return 0 //to avoid spamming with insulated glvoes on
//Checks again. If we are still here subject will be shocked, trigger standard 20 tick warning
//Since this one is longer it will override the original one.
if(PN)
PN.trigger_warning()
if (!cell && !PN)
return 0
var/PN_damage = 0