[MIRROR] Fix blanket cure_blind calls removing quirk and blindfold traits (#6673)

* Fix blanket cure_blind calls removing quirk and blindfold traits (#59943)

Makes it so when proc/cure_blind(source) is called with no source is does not cure blindness from the quirk, blindfolds, or other eye coverings.

* Fix blanket cure_blind calls removing quirk and blindfold traits

Co-authored-by: Wayland-Smithy <64715958+Wayland-Smithy@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-07-03 22:23:16 +01:00
committed by GitHub
co-authored by Wayland-Smithy
parent cda689393e
commit 5cbd17b6f9
2 changed files with 28 additions and 1 deletions
+24
View File
@@ -44,6 +44,30 @@
}; \
} \
} while (0)
#define REMOVE_TRAIT_NOT_FROM(target, trait, sources) \
do { \
var/list/_traits_list = target.status_traits; \
var/list/_sources_list; \
if (sources && !islist(sources)) { \
_sources_list = list(sources); \
} else { \
_sources_list = sources\
}; \
if (_traits_list && _traits_list[trait]) { \
for (var/_trait_source in _traits_list[trait]) { \
if (!(_trait_source in _sources_list)) { \
_traits_list[trait] -= _trait_source \
} \
};\
if (!length(_traits_list[trait])) { \
_traits_list -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
}; \
if (!length(_traits_list)) { \
target.status_traits = null \
}; \
} \
} while (0)
#define REMOVE_TRAITS_NOT_IN(target, sources) \
do { \
var/list/_L = target.status_traits; \
+4 -1
View File
@@ -450,7 +450,10 @@
/////////////////////////////////// TRAIT PROCS ////////////////////////////////////
/mob/living/proc/cure_blind(source)
REMOVE_TRAIT(src, TRAIT_BLIND, source)
if(source)
REMOVE_TRAIT(src, TRAIT_BLIND, source)
else
REMOVE_TRAIT_NOT_FROM(src, TRAIT_BLIND, list(QUIRK_TRAIT, EYES_COVERED, BLINDFOLD_TRAIT))
if(!HAS_TRAIT(src, TRAIT_BLIND))
update_blindness()