diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-06-25 10:09:17 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-06-25 10:09:17 -0300 |
| commit | ea319bc2fbef91e3ea062be554b215756648d1d3 (patch) | |
| tree | aa26422a754346e9881e5e0b510f78fd4cfe068c /src/crcombat.cc | |
| parent | 8bc2e5dc3a523af471065752a534d20d878c60b0 (diff) | |
| download | game-ea319bc2fbef91e3ea062be554b215756648d1d3.tar.gz game-ea319bc2fbef91e3ea062be554b215756648d1d3.zip | |
finish `crnonpl.cc`
Diffstat (limited to 'src/crcombat.cc')
| -rw-r--r-- | src/crcombat.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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>( + int Distance = std::max<int>( std::abs(Master->posx - Target->posx), std::abs(Master->posy - Target->posy)); |
