Ecosystem-2 icon indicating copy to clipboard operation
Ecosystem-2 copied to clipboard

The bunny is in moveFromCoord, not coord

Open ericwerk opened this issue 6 years ago • 1 comments

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

ericwerk avatar Aug 17 '19 18:08 ericwerk

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.

VengantMjolnir avatar Oct 14 '20 18:10 VengantMjolnir