mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
[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:
co-authored by
Wayland-Smithy
parent
cda689393e
commit
5cbd17b6f9
@@ -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; \
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user