OneLife icon indicating copy to clipboard operation
OneLife copied to clipboard

Changing biome.

Open AlecYawata opened this issue 7 years ago • 1 comments

First, this is just display bug. (Server side biomes hasn't change never)

Server send chunk message to client for notice map objects and biomes in getChunkMessage. That function doesn't call getMapBiomeIndex() if already lastCheckedBiome has setted from getBaseMap().

https://github.com/jasonrohrer/OneLife/blob/master/server/map.cpp#L5406 https://github.com/jasonrohrer/OneLife/blob/master/server/map.cpp#L1135

But, getChunkMessage will call getMapObject(). https://github.com/jasonrohrer/OneLife/blob/master/server/map.cpp#L5404

Its means, getMapObject() call checkDecayObject(), and getBaseMap() will be called with another position if objects is animal(has move).

So, getChunkMessage got wrong lastCheckedBiome in very rare case. (Very rare, because always getMapObjectRaw() will be called with true position before checkDecayObject(). If...yes, if you doesn't care about "mapCache")

Reproduction video. https://drive.google.com/open?id=1KUZMPYWrPUZQE5drdUkudktLTzI9WGn2

RecordedGame [recordedGame000151.txt] (https://github.com/jasonrohrer/OneLife/files/3318650/recordedGame000151.txt)

Way to reproduce. 0. Change BASE_MAP_CACHE_SIZE to "32". and rebuild server. (https://github.com/jasonrohrer/OneLife/blob/master/server/map.cpp#L965)

  1. Set forceEveLocationX, Y to (-19979,-11007).
  2. Login.
  3. You can see bison at your right. Its in yellow biome.
  4. Run to edge of biome (between yellow and green) in left as soon.
  5. Wait 10 seconds.
  6. Return to bison.
  7. Maybe you can see bison in another biome.

betsst, Thank you for your corporation.

AlecYawata avatar Jun 23 '19 22:06 AlecYawata

Wow, thank you!

jasonrohrer avatar Jul 03 '19 23:07 jasonrohrer