mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user