From 5dea49df137681616075519c819b694ca1189c74 Mon Sep 17 00:00:00 2001 From: Filatelele Date: Mon, 30 Oct 2023 12:08:24 +0300 Subject: [PATCH] fix(commanded): fixed bugs in simple_animal/hostile/commanded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #10800 fixes #10796 - Теперь медведи мага должны корректно атаковать цели. --- .../living/simple_animal/hostile/commanded/commanded.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm b/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm index ea086a75b02..688cad714ed 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm @@ -53,11 +53,13 @@ continue if(isliving(A)) M = A - if(istype(A,/obj/mecha)) + else if(istype(A,/obj/mecha)) var/obj/mecha/mecha = A if(!mecha.occupant) continue M = mecha.occupant + else // If it is not living and not /obj/mecha/, then we have something strange going on. + continue if(M && M.stat) continue if(mode == "specific") @@ -190,3 +192,8 @@ stance = HOSTILE_STANCE_ATTACK if(weakref(M) in friends) friends -= weakref(M) + +/mob/living/simple_animal/hostile/commanded/AttackingTarget() + if(!client && target_mob == master) // we don't want mob attacking its master + return + . = ..()