diagnostic tool fixes
This commit is contained in:
@ -23,11 +23,11 @@ func (mov Moveable) Walk() {
|
||||
|
||||
//fixme change it to WhatsOnTile
|
||||
func (mov Moveable) IsBlocked(c types.Coords) bool {
|
||||
if mov.Level.GetTile(c).BlocksPass == true {
|
||||
if mov.Level.GetTile(c).BlocksPass {
|
||||
return true
|
||||
}
|
||||
list := mov.Controller.GetEntitiesWithComponent(ecs.MobComponent)
|
||||
for idx, _ := range list {
|
||||
for idx := range list {
|
||||
coords := mov.Controller.GetComponent(list[idx], ecs.CoordsComponent)
|
||||
if coords == nil {
|
||||
continue
|
||||
@ -50,7 +50,7 @@ func (mov Moveable) IsBlocked(c types.Coords) bool {
|
||||
func Walk(entity ecs.Entity, state *gamestate.GameState, dx, dy int) {
|
||||
controller := state.Controller
|
||||
coords := controller.GetComponent(state.Player, ecs.CoordsComponent).(types.Coords)
|
||||
newCoords := types.Coords{coords.X + dx, coords.Y + dy}
|
||||
newCoords := types.Coords{X: coords.X + dx, Y: coords.Y + dy}
|
||||
if !state.Level.InBounds(newCoords) {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user