I have recently encountered a strange issue that is hard to reproduce, and I have no idea what could have caused it in the first place. Sometimes I will find units whose positional coordinates are not actually at the plot that contains them. It looks like this in the game:
As you can see, the unit standard is at the tile but the unit art is not displayed.
When I end turn, it triggers the following assertion:
When I continue from this breaking point, the game crashes when it encounters a null pointer:
The game also crashes when trying to delete the unit in world builder. I can clean the null entry from the plot unit queue (I have done so before) but that doesn't answer the question of how this weird state even comes about. A cursory glance at the code suggests that methods usually make sure to keep units and plots in sync. I'm kind of at a loss about both why a unit's plot would not match its coordinates and why it would become null shortly after that.
Any ideas?
Spoiler :
As you can see, the unit standard is at the tile but the unit art is not displayed.
When I end turn, it triggers the following assertion:
Spoiler :
When I continue from this breaking point, the game crashes when it encounters a null pointer:
Spoiler :
The game also crashes when trying to delete the unit in world builder. I can clean the null entry from the plot unit queue (I have done so before) but that doesn't answer the question of how this weird state even comes about. A cursory glance at the code suggests that methods usually make sure to keep units and plots in sync. I'm kind of at a loss about both why a unit's plot would not match its coordinates and why it would become null shortly after that.
Any ideas?