Closed ilteroi closed 7 years ago
They should DOW the next turn though, as they've encountered the enemy.
Also fixed a typo in setupsinglearmy. Naval attacks always fail because the pDeployPlot->iswater() should be negative, not positive!
What are those yellow promo icons above? What is the mod called? Do tell me, for I desire to get them myself.
nah. they moved over to sparta, then made a demand i didn't want to fulfill, then declared war and turned on corinth after all. conquered it after two turns of siege. smooth, except for the lost time, which i could have used to build an army.
the mod is called flag promotions (not to be confused with thal's flag promotions, that one is not compatible)
That's odd, did we remove the trigger for the AI to 'successfully end' operations if they run into a target unit or target land?
i made the conditions a bit stricter, yes.
enemy units are handled now without disbanding the operation.
for sneak ops they aren't enemies yet, so they have special code. but in this case there was no enemy unit adjacent to the army, so no trigger. probably should check visibility instead.
That makes sense.
nevertheless corinth should have been the target in the first place. can you take a look?
Yeah, looking at it now. Going to amp up the desirability for the 'closest' city for a sneak attack.
@ilteroi, quick question - is StableSortItems in cvmilitaryAI sorting high > low, or high < low? I can't seem to find the code.
depends on the definition of operator < for the item type
Nevermind, looks fine, false alarm.
Another question:
In int CvMilitaryAI::GetCachedAttackTargetLandDistance should a value of -1 be permitted as a cached value? Seems like it should, as land distances don't change (and aren't affected by things like ocean movement or coastal movement). Thoughts? (I see lots of calls to refresh the land distance cache in custommods.csv).
well, -1 would mean unreachable right? so it's valid. but it might change anyway because of open borders or razed cities. so you need to refresh it nevertheless.
switched to a visibility check and it works beautifully. no chance to defend.
Great!
this is supposed to be a sneak attack ... on sparta!
maybe target selection needs to be tweaked a bit