Somebody613
Somebody613
- Joined
- Nov 18, 2019
- Messages
- 2,813
Can you have SEVERAL same-type checks one after another in the code?Oh... yeah that's probably what they were looking at. hmm... There are other ways to address this of course. Like requiring that the current build category (unit/building/wonder) not change without forcing a break, which is what I thought we were operating with in the first place. That would far more directly apply to eliminating loopholes that are probably still allowed otherwise. You could do this to finish a building quickly as well right now, even if said building was not a wonder. That would also manage the food issue to at least keep buildings of any kind from being the recipient of food production directly.
Like:
CHECK 1
Find out the FIRST item's category and modifiers. Calculate overflow to the next item.
If non-zero, go next.
If zero, BREAK
CHECK 2
Find out the NEXT item's category and modifiers. RE-calculate leftover overflow according to the new data.
If non-zero, LOOP between C1 and C2 until you use up all of the turn's production.
If zero, BREAK.
I tried putting this into CODE, but it's too new for me to do it on the spot.
But I hope this explanation was simple enough to convert it into the CODE - which is rather simple itself, I was just confused by the LOOPING mechanism.
EDIT:
Oh, you simply need to introduce "Basic_Production" alongside "Factual_Production" for this to work.
Then use "%_of_BP being used up by FP for this item" in the end recalculation of a check.
Quite simple, really.