What's the rationale behind this change?
Also, are all these changes part of the CP as well? Because the change with DoW's requiring an embassy seems to go beyond bugfixing and into what CBP is trying to do.
I agree, buying back your own city should ideally be exempt from this rule. However according to the other thread, you can trade cities as part of a peace negotiation while (obviously) not being friends, but I guess that might be difficult to afford for the losing party.I agree, what is the rationale behind this change? It makes sense that my past enemies would want their cities back after a bad war by giving me a lump sum of gold, but they have to be my friends also to buy their cities back?
ok guys, sorry for this strange crash, i've put in some additional logging, maybe that will help to find the root cause.
you can find a new build at https://dl.dropboxusercontent.com/u/16988401/civ/CvGameCore_Expansion2.zip - please place it in your CP folder, let it run and watch the output in TraceSpy.
I agree, buying back your own city should ideally be exempt from this rule. However according to the other thread, you can trade cities as part of a peace negotiation while (obviously) not being friends, but I guess that might be difficult to afford for the losing party.
UnitHandle pUnit = m_pPlayer->getUnit(*it);
for(it = m_CurrentTurnUnits.begin(); it < m_CurrentTurnUnits.end(); it++)
Bittersweet, nice to see you incorporated my suggestions into the code, horrible to see they did not make a difference...
Crash at turn 14.
The drudgery continues...
Well I consider it more like a hostage exchange. It's not a major deal for me, but I do think it's very likely that there will be situations where you might not find a swap right at the time of peace negotiations acceptable because one part is likely to be starved for resources at that time - whereas a trade at a later time could be meaningful. That's why I think that ideally (and by ideally I mean: I don't know if it's possible to code this) but ideally, a player should always be able to make a trade offer for a city they've founded themselves, whereas trades that involve giving away one of their own cities (and possibly also third party cities) only should be possible between DoF friends.Hostile parties cannot and should not buy and sell land from each other. If you want land and you are not their friend, your recourse is war. This feels far more natural, and I thank Edaka for pointing out what should have been blatantly obvious to me.
G
What's your choice of map and civ, if I may ask? Do these choices make a difference for the CTD for you? Do you restart the map once loaded, or just dive straight in? Are you using the standard civ lua, or are you using ilteroi's moded lua51 file?
Bittersweet, nice to see you incorporated my suggestions into the code, horrible to see they did not make a difference...
Crash at turn 14.
The drudgery continues...
Only thing I can think of now, is that if you are getting index-out-of-bounds exception here:
Code:UnitHandle pUnit = m_pPlayer->getUnit(*it);
... then perhaps it is a good idea to constrain the loop to values only under the end of the iterator (as it is now, any value that is not the final of the iterator will continue the loop, even if the value is out of bounds of getUnit(it)...), like this:
Code:for(it = m_CurrentTurnUnits.begin(); it < m_CurrentTurnUnits.end(); it++)
I know it generally works, but if it is there that you are getting IOOB exceptions, then obviously somehow it > CurrentTurnsUnits.end() in some cases... why not eliminate that possibility altogether?
Just shooting blindly again, but maybe, just maybe...
Either that, or CurrentTurnUnits somehow has more unit IDs than whatever list the function getUnit(int) calls from...
Another possibility is that having the same name for the iterators (it) in nested loops may confuse the compiler? They are smarter now, but AFAIK it is a big NONO in programming to use same names for nested variables, especially in loops... I know, scope and all that, but maybe this is what is loading the variable "it" more than it should (combined with the soft limit in the for loop, != instead of <), and then you get the OOB exception... what if you use slightly different variable names for the internal loops, like it2, it3, and so on...?
I've try a quick test and the previous save still crash at the same point (turn 38), but in a new game no crash still (turn 70).
...
The iterator is going OOB or calling a bad pointer.
Since the former is nigh impossible, the second is the most viable area of interest. The other problem here, though, is that the same currentmoveunit loop is called over and over again in the cvtacticalAI, which makes me think that there's something broken in the ranged recruitment model for safebombards that's seeding bad data into that function. But, then again, that's doesn't necessarily make sense either, as there are other ranged unit calls that aren't breaking.
This is the loop that I'm in right now.
G
hello again.
i think i got it. anyone care to give it a try? i still don't know why it was crashing only for some people, but there's a spot where it could plausibly crash (iterator invalidated by a remove call on an stl container).
https://dl.dropboxusercontent.com/u/16988401/civ/CvGameCore_Expansion2.zip
hello again.
i think i got it. anyone care to give it a try? i still don't know why it was crashing only for some people, but there's a spot where it could plausibly crash (iterator invalidated by a remove call on an stl container).
https://dl.dropboxusercontent.com/u/16988401/civ/CvGameCore_Expansion2.zip
hello again.
i think i got it. anyone care to give it a try? i still don't know why it was crashing only for some people, but there's a spot where it could plausibly crash (iterator invalidated by a remove call on an stl container).
https://dl.dropboxusercontent.com/u/16988401/civ/CvGameCore_Expansion2.zip