From 89ded4fc4dd7affa516abaf500f6ce86d9260bfb Mon Sep 17 00:00:00 2001 From: 4dplanner <3combined@gmail.com> Date: Tue, 29 Jan 2019 12:40:02 +0000 Subject: [PATCH 1/3] Antimagic works again --- code/datums/components/anti_magic.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/datums/components/anti_magic.dm b/code/datums/components/anti_magic.dm index 908aef45115..f4d6fa98b0e 100644 --- a/code/datums/components/anti_magic.dm +++ b/code/datums/components/anti_magic.dm @@ -33,12 +33,14 @@ UnregisterSignal(user, COMSIG_MOB_RECEIVE_MAGIC) /datum/component/anti_magic/proc/protect(datum/source, mob/user, _magic, _holy, major, self, list/protection_sources) - if(((_magic && magic) || (_holy && holy)) && (self && blocks_self)) + if(((_magic && magic) || (_holy && holy)) && (!self || !blocks_self)) protection_sources += parent - reaction.Invoke(user, major) + if(reaction) + reaction.Invoke(user, major) if(major) charges-- if(charges <= 0) - expire.Invoke(user) + if(expire) + expire.Invoke(user) return COMPONENT_BLOCK_MAGIC From 7a707d3c8f76a031a9e2316aa4f2b4dfe078b206 Mon Sep 17 00:00:00 2001 From: 4dplanner <3combined@gmail.com> Date: Tue, 29 Jan 2019 13:11:04 +0000 Subject: [PATCH 2/3] ! --- code/datums/components/anti_magic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/components/anti_magic.dm b/code/datums/components/anti_magic.dm index f4d6fa98b0e..373b818cc11 100644 --- a/code/datums/components/anti_magic.dm +++ b/code/datums/components/anti_magic.dm @@ -33,7 +33,7 @@ UnregisterSignal(user, COMSIG_MOB_RECEIVE_MAGIC) /datum/component/anti_magic/proc/protect(datum/source, mob/user, _magic, _holy, major, self, list/protection_sources) - if(((_magic && magic) || (_holy && holy)) && (!self || !blocks_self)) + if(((_magic && magic) || (_holy && holy)) && (!self || blocks_self)) protection_sources += parent if(reaction) reaction.Invoke(user, major) From 7ad8fa48c6db7440b63f048fe32b7913c856a7ba Mon Sep 17 00:00:00 2001 From: 4dplanner <3combined@gmail.com> Date: Tue, 29 Jan 2019 18:34:48 +0000 Subject: [PATCH 3/3] ?. --- code/datums/components/anti_magic.dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/datums/components/anti_magic.dm b/code/datums/components/anti_magic.dm index 373b818cc11..9b03284513a 100644 --- a/code/datums/components/anti_magic.dm +++ b/code/datums/components/anti_magic.dm @@ -35,12 +35,10 @@ /datum/component/anti_magic/proc/protect(datum/source, mob/user, _magic, _holy, major, self, list/protection_sources) if(((_magic && magic) || (_holy && holy)) && (!self || blocks_self)) protection_sources += parent - if(reaction) - reaction.Invoke(user, major) + reaction?.Invoke(user, major) if(major) charges-- if(charges <= 0) - if(expire) - expire.Invoke(user) + expire?.Invoke(user) return COMPONENT_BLOCK_MAGIC