FlinTyX / Animalia

A fun mod that contains Animals, Plants, Natural disasters and a lot more!
GNU General Public License v3.0
44 stars 6 forks source link

use a daemon thread to get water tiles instead #3

Closed code-explorer786 closed 2 years ago

code-explorer786 commented 2 years ago

this pr is untested because i'm clearly on mobile

please test this and see if the game crashes for whatever reason thanks

what is this all about

so i was playing on mobile with your mod (in a 500x500 map, unfortunately) and it suddenly gets lagspikes for some reason, and suddenly frogs appear i checked the source code and found the cause, which is checking all tiles in the main thread coincidentally, i found out about threads in Mindustry days ago, so why not

Br0ad commented 2 years ago

A much good idea

FlinTyX commented 2 years ago

The code works just fine. Lag spikes are gone after the world is totaly loaded and the core lands. I've made some changes to the old code, so I will merge it and then push the new one (it only has some team changes and thats it, your code will stay there)