Skip to content

Commit

Permalink
Merge pull request #419 from MUnique/dev/fix-monster-attack-range
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n authored Jun 21, 2024
2 parents 254630f + 76c68f4 commit 918e936
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override async ValueTask TickAsync()
}

var targetsInRange = this.PossibleTargets.Where(target => this.Trap.GetDirectionTo(target) == this.Trap.Rotation)
.Where(target => this.Trap.IsInRange(target.Position, this.Trap.Definition.AttackRange + 1))
.Where(target => this.Trap.IsInRange(target.Position, this.Trap.Definition.AttackRange))
.Where(target => !this.Map.Terrain.SafezoneMap[target.Position.X, target.Position.Y]);

bool hasAttacked = false;
Expand Down
2 changes: 1 addition & 1 deletion src/GameLogic/NPC/BasicMonsterIntelligence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private async ValueTask TickAsync()
}

// Target in Attack Range?
if (target.IsInRange(this.Monster.Position, this.Monster.Definition.AttackRange + 1) && !this.Monster.IsAtSafezone())
if (target.IsInRange(this.Monster.Position, this.Monster.Definition.AttackRange) && !this.Monster.IsAtSafezone())
{
await this.Monster.AttackAsync(target).ConfigureAwait(false); // yes, attack
return;
Expand Down

0 comments on commit 918e936

Please sign in to comment.