eronoobos / ShardSpringLua

gadget for Spring RTS that loads Shard AI as a Lua AI, see https://github.com/eronoobos/Shard
0 stars 1 forks source link

two AIs in the same game sometimes mix up whose data is whose #8

Open eronoobos opened 8 years ago

eronoobos commented 8 years ago

see https://github.com/eronoobos/BABAR-The-Shardifant/issues/10

This is almost without a doubt caused by the ai, game and map globals set before every call to the AI in AILoader.lua . Is it possible that while executing one call to one AI, another call is invoked by a UnitDead or some other Spring callin, thus switching what ai refers to?

This would all be a non-issue if the global ai object was never used, and instead everything was within modules and behaviours self.ai. But for the BA/BAR config, that would take a lot of refactoring.