konstructs / server

A voxel based game server.
http://www.konstructs.org
MIT License
49 stars 12 forks source link

Fix flooding migration bug #144

Closed petterarvidsson closed 7 years ago

petterarvidsson commented 7 years ago

@nsg This fixes the ambient light migration bug. It uses another strategy where each migrated chunk always ask the chunk above to refresh (if possible trigger update to all adjacent blocks) of all blocks in the lower most layer of the chunk. If the chunk above also wasn't migrated it will do the same so it propagates nicely upwards until we hit a non existent chunk. This works since space vacuum is now considered for refresh and has full ambient light (it should always have had that, it was a bug). This doesn't create an infinite update since the actual flooding triggered by the refresh will still not flood into space vacuum.

Tested on play world, and it at least solves the old bug. It also takes a bit more time due to the old bug skipping parts of the world...

nsg commented 7 years ago

@petterarvidsson works fine for me :+1: