From ea319bc2fbef91e3ea062be554b215756648d1d3 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Wed, 25 Jun 2025 10:09:17 -0300 Subject: finish `crnonpl.cc` --- src/crcombat.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/crcombat.cc') diff --git a/src/crcombat.cc b/src/crcombat.cc index 0b45ea4..df8b312 100644 --- a/src/crcombat.cc +++ b/src/crcombat.cc @@ -420,7 +420,7 @@ void TCombat::SetAttackDest(uint32 TargetID, bool Follow){ } if(Master->Type == PLAYER && Target->Type != PLAYER){ - if(Target->Outfit.OutfitID == 0 && Target->Outfit.ObjectType == 0){ + if(Target->IsInvisible()){ this->StopAttack(0); throw TARGETLOST; } @@ -463,7 +463,7 @@ void TCombat::CanToDoAttack(void){ } if(Master->Type == PLAYER && Target->Type != PLAYER){ - if(Target->Outfit.OutfitID == 0 && Target->Outfit.ObjectType == 0){ + if(Target->IsInvisible()){ this->StopAttack(0); throw TARGETLOST; } @@ -559,7 +559,7 @@ void TCombat::Attack(void){ } if(Master->Type == PLAYER && Target->Type != PLAYER){ - if(Target->Outfit.OutfitID == 0 && Target->Outfit.ObjectType == 0){ + if(Target->IsInvisible()){ this->StopAttack(0); throw TARGETLOST; } @@ -696,7 +696,7 @@ void TCombat::WandAttack(TCreature *Target){ ASSERT(this->Wand != NONE); TCreature *Master = this->Master; - int Distance = std::min( + int Distance = std::max( std::abs(Master->posx - Target->posx), std::abs(Master->posy - Target->posy)); -- cgit v1.2.3