1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-11 18:20:42 +00:00

Finished orientation values. (#198)

* Finished directions for entity.
This commit is contained in:
Tim Sarbin 2019-11-17 02:54:22 -05:00 committed by GitHub
parent 297184376f
commit 4254b0f020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package d2scene
import (
"image/color"
"log"
"github.com/OpenDiablo2/D2Shared/d2helper"
@ -113,7 +112,6 @@ func (v *Game) Update(tickTime float64) {
newDirection := d2render.DirectionLookup[directionIndex]
if newDirection != v.mapEngine.Hero.AnimatedEntity.GetDirection() {
v.mapEngine.Hero.AnimatedEntity.SetMode(d2enum.AnimationModePlayerTownNeutral.String(), v.mapEngine.Hero.Equipment.RightHand.GetWeaponClass(), newDirection)
log.Printf("Angle: %d -> %d", directionIndex, newDirection)
}
}

View File

@ -73,7 +73,7 @@ func CreateAnimatedEntity(x, y int32, object *d2datadict.ObjectLookupRecord, fil
}
// DirectionLookup is used to decode the direction offset indexes
var DirectionLookup = []int{9, 15, 5, 6, 4, 10, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0}
var DirectionLookup = []int{9, 15, 5, 6, 4, 12, 10, 2, 8, 13, 1, 7, 0, 14, 11, 3}
func (v AnimatedEntity) GetDirection() int {
return v.direction