1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-16 04:25:23 +00:00

Fixed compile error (#244)

This commit is contained in:
Tim Sarbin 2019-12-06 17:52:35 -05:00 committed by GitHub
parent b5db51800c
commit 87e016617a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,7 +319,7 @@ func (v *AnimatedEntity) getStepLength(tickTime float64) (float64, float64) {
v.TargetX,
v.TargetY,
)
radians := (math.Pi / 180.0) * angle
radians := (math.Pi / 180.0) * float64(angle)
oneStepX := length * math.Cos(radians)
oneStepY := length * math.Sin(radians)
return oneStepX, oneStepY
@ -368,7 +368,7 @@ func (v *AnimatedEntity) SetTarget(tx, ty float64) {
newAnimationMode = d2enum.AnimationModeMonsterWalk.String()
}
newDirection := angleToDirection(angle, v.Cof.NumberOfDirections)
newDirection := angleToDirection(float64(angle), v.Cof.NumberOfDirections)
if newDirection != v.GetDirection() || newAnimationMode != v.animationMode {
v.SetMode(newAnimationMode, v.weaponClass, newDirection)
}