Skip to content

The bunny is in moveFromCoord, not coord#6

Open
ericwerk wants to merge 1 commit intoSebLague:masterfrom
ericwerk:master
Open

The bunny is in moveFromCoord, not coord#6
ericwerk wants to merge 1 commit intoSebLague:masterfrom
ericwerk:master

Conversation

@ericwerk
Copy link

Not sure why you have both a "coord" and a "moveFromCoord", but you want the latter here.

@VengantMjolnir
Copy link

I don't think this is correct. 'coord' is the animal's current position while moveFromCoord is its previous coordinate. This is used in the StartMoveToCoord() method in Act(), where it is passed a next tile that is retrieved from the Environment with a weighting towards the animals current 'forward' direction. This is determined from its previous position.

I have not debugged the app to ensure it is correctly removing the animal from the Map with 'coord', but I suspect it is. Your change would cause the animal to lose the ability to move in a weighted direction. The other wrinkle is that a Map isn't a list by exact coordinate, but rather a list by 'region'. This is likely why your change appears to work since the coordinates near each other are likely in the same region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants