From dcf4c2a96065e23a0e9ce07721fbf52834fc3ffd Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 17 Sep 2022 20:46:05 +0200 Subject: [PATCH] [MIRROR] Fixes voice of god runtime when a target resists the command [MDB IGNORE] (#16264) * Fixes voice of god runtime when a target resists the command (#69921) * Fixes voice of god runtime when a target resisted your command and adds a grep to avoid it being a problem again in the future. * Fixes voice of god runtime when a target resists the command Co-authored-by: ShizCalev --- code/datums/voice_of_god_command.dm | 2 +- code/modules/reagents/chemistry/recipes/others.dm | 1 - tools/ci/check_grep.sh | 5 +++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/datums/voice_of_god_command.dm b/code/datums/voice_of_god_command.dm index a9ccb19be21..4f12b007ab5 100644 --- a/code/datums/voice_of_god_command.dm +++ b/code/datums/voice_of_god_command.dm @@ -46,7 +46,7 @@ GLOBAL_LIST_INIT(voice_of_god_commands, init_voice_of_god_commands()) for(var/mob/living/candidate in candidates) if(candidate.stat != DEAD && candidate.can_hear()) if(candidate.can_block_magic(MAGIC_RESISTANCE_HOLY|MAGIC_RESISTANCE_MIND, charge_cost = 0)) - to_chat(span_userdanger("Something's wrong! [candidate] seems to be resisting your commands.")) + to_chat(user, span_userdanger("Something's wrong! [candidate] seems to be resisting your commands.")) continue listeners += candidate diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index b0ff59d0372..fbcd3ff18fd 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -882,7 +882,6 @@ do_teleport(nearby_mob, get_turf(holder.my_atom), 3, no_effects=TRUE) nearby_mob.Knockdown(20, TRUE) nearby_mob.add_atom_colour("#cebfff", WASHABLE_COLOUR_PRIORITY) - to_chat() do_sparks(3,FALSE,nearby_mob) clear_products(holder, step_volume_added) diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh index 4e4ef117a6c..928b1b2ef3f 100644 --- a/tools/ci/check_grep.sh +++ b/tools/ci/check_grep.sh @@ -244,6 +244,11 @@ done < <(find . -type f -name '*.dm') echo -e "${BLUE}Checking for common mistakes...${NC}" +if grep -P 'to_chat\((?!.*,).*\)' code/**/*.dm; then + echo + echo -e "${RED}ERROR: to_chat() missing arguments.${NC}" + st=1 +fi; if grep -P 'addtimer\((?=.*TIMER_OVERRIDE)(?!.*TIMER_UNIQUE).*\)' code/**/*.dm; then echo echo -e "${RED}ERROR: TIMER_OVERRIDE used without TIMER_UNIQUE.${NC}"