Skip to content

Commit

Permalink
fix los on player pos
Browse files Browse the repository at this point in the history
  • Loading branch information
tivvit committed Oct 10, 2023
1 parent d183937 commit 8c37497
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/dungeonsandtrolls/gameobject/los.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func rayTrace(currentLevel *api.Level, resultMap map[PlainPos]MapCellExt, slope
dy := y2 - y1

if dx == 0 && dy == 0 {
return 0
return math.MaxFloat32
}

// Calculate absolute values of dx and dy
Expand Down
2 changes: 1 addition & 1 deletion server/dungeonsandtrolls/handlers/skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func validateSkill(game *dungeonsandtrolls.Game, skillUse *api.SkillUse, p gameo
}

if !gameobject.GetLoS(currentLevel, resultMap, map[float32]float32{}, gameobject.CoordinatesToPosition(p.GetPosition()), targetPos) {
return fmt.Errorf("target is not in los")
return fmt.Errorf("target is not in line of sight")
}
}
if s.Flags.RequiresOutOfCombat {
Expand Down

0 comments on commit 8c37497

Please sign in to comment.