diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-10-11 17:52:18 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-10-11 17:52:18 -0300 |
| commit | 60531bf63e9d93535e6d7ea5201a708392e738f6 (patch) | |
| tree | 24faed10533f9ee200e02fba53cb15107a5bbafa | |
| parent | 9a8bab9ff3b13c8f1d261d51ffc301b6e59969c9 (diff) | |
| download | game-60531bf63e9d93535e6d7ea5201a708392e738f6.tar.gz game-60531bf63e9d93535e6d7ea5201a708392e738f6.zip | |
fix problem with targeting - fixes #38
| -rw-r--r-- | src/crcombat.cc | 20 |
1 files changed, 8 insertions, 12 deletions
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; } } } |
