widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #16017
Re: [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands
>From my understanding we can't put this in a coroutine, because:
wl.Game().map.valuable_fields
blocks the lua script, as long as it is calculating, and these
calculations eat up all available cpu.
With this
run(function()
fields = wl.Game().map.valuable_fields
end)
it runs in a coroutine, but the game stalls until the calculations are
done.
It isn't a real coroutine either, because we need to call
coroutine.yield()
from within the coroutine to pause it. But we can't since the c++ part
blocks the script.
--
https://code.launchpad.net/~widelands-dev/widelands/bug-1810062-territorial-calculations/+merge/361366
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1810062-territorial-calculations.
References