tlongstretch / freeserf-with-AI-plus

THIS PROJECT WAS MOVED TO 'Forkserf', GO THERE INSTEAD
https://github.com/forkserf/forkserf
GNU General Public License v3.0
1 stars 0 forks source link

AI logic - array out of bounds issue as new Stock is completed? #64

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

I think this may be happening when a stock is completed in the middle of an AI loop and a flagsearch finds it, but there is no reference to it in stock_buildings so stock_buildings.at(inventory_pos) fails for this Inventory.

either add a if (stock_buildings.count(inventory_pos) && before each call...

OR, call update_stocks_pos if an unknown active stock is found inside a flagsearch (find_nearest_inventory?)

tlongstretch commented 3 years ago

fixed by one of many changes