From 60531bf63e9d93535e6d7ea5201a708392e738f6 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 11 Oct 2025 17:52:18 -0300 Subject: fix problem with targeting - fixes #38 --- src/crcombat.cc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/crcombat.cc b/src/crcombat.cc index ef4b2f7..e8bede9 100644 --- a/src/crcombat.cc +++ b/src/crcombat.cc @@ -400,19 +400,15 @@ void TCombat::SetAttackDest(uint32 TargetID, bool Follow){ } } - if(WorldType == NON_PVP){ - if(!Master->IsPeaceful() || !Target->IsPeaceful()){ - if(Target->Type == NPC){ - this->StopAttack(0); - throw ATTACKNOTALLOWED; - } - } + if(Target->Type == NPC){ + this->StopAttack(0); + throw ATTACKNOTALLOWED; + } - if(Master->Type == PLAYER){ - if(Target->Type == NPC || !CheckRight(Master->ID, ATTACK_EVERYWHERE)){ - this->StopAttack(0); - throw ATTACKNOTALLOWED; - } + if(WorldType == NON_PVP && Master->IsPeaceful() && Target->IsPeaceful()){ + if(Master->Type != PLAYER || !CheckRight(Master->ID, ATTACK_EVERYWHERE)){ + this->StopAttack(0); + throw ATTACKNOTALLOWED; } } } -- cgit v1.2.3