← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1718745-allows-seafaring into lp:widelands

 

Exactly, that is what static means - there is only 1 instance of the variable for all objects. This is also the reason why it can't be initialized in the constructor, because there are no individual copies of the variable, and it can be initialized only once.

Since whether a map is seafaring does not depend on which AI is doing the check, having a global check triggered about ever 5 seconds is sufficient. So, it won't cost extra load when we have lots of AIs, because only one of them will check for everybody.

I'm now wondering if that actually works, since seafaring_economy is not static. It does some check for if there is a ship being built somewhere else in the AI code - is this check actually needed now?
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1718745-allows-seafaring/+merge/333233
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1718745-allows-seafaring.


References