Ok, rare it is then. Will look at it as soon as I set up yet another project and compiled all of it >_<
No need, I just wonder if similar effort is necessary for declareWar or other functions.Do you want me to remove that check in CvTeam::makePeace, set a breakpoint in setIsMinorCiv and check the callstack?
Yes mamba, it should not happen, we all agree. Too bad it still does.
Actually I think I fixed a symptom. The cause is declaring war and making peace with dead teams, that's a unique behavior of minor civs. Not sure if it's faulty by design, but at least it's unique.you seem to have fixed the root cause![]()
[COLOR="Green"]//return (0 == iCount) ? 50 * iHappy : iHappyValue / iCount;[/COLOR]
if (iCount <= 0)
{
[COLOR="Green"]//iValue += (getNumCities() * 12 * 50 * iHappy) / 100; //always 0 because 0 cities[/COLOR]
}
else
{
[COLOR="Green"]//iValue += (getNumCities() * 12 * iHappyValue) / (100 * iCount);[/COLOR]
[COLOR="Green"]// line below is equal to line above[/COLOR]
iValue += (getNumCities() * 3 * iHappyValue) / (25 * iCount);
}
[COLOR="Green"]//return (0 == iCount) ? 50*iHealth : iHealthValue / iCount;[/COLOR]
if (iCount <= 0)
{
[COLOR="Green"]//iValue += (getNumCities() * 6 *50*iHealth) / 100; // always zero because 0 cities[/COLOR]
}
else
{
[COLOR="Green"]//iValue += (getNumCities() * 6 * iHealthValue) / (100 * iCount);[/COLOR]
[COLOR="Green"]// line below is equal to line above[/COLOR]
iValue += (getNumCities() * 3 * iHealthValue) / (50 * iCount);
}
if( gUnitLogLevel > 2 )
{
CvWString szString;
getUnitAIString(szString, pBestUnit->AI_getUnitAIType());
logBBAI(" Great general %d for %S chooses to lead %S with UNITAI %S", getID(), GET_PLAYER(getOwner()).getCivilizationDescription(0), pBestUnit->getName(0).GetCString(), szString[B].GetCString()[/B] );
}
You must be mistaken![]()
rev 544 had this listed in the log: Fixed Rogue Popups with AI Autoplay Enabled.
You must be mistaken
CvUnit::canMoveInto has an issue but that's not one that causes crashes:
Undefended cities can not be conquered
I reverted to original code in Better BUG AI as recommended; RevDCM and LoR still have that problem though.
When loaded your savegame I did get any access violation but that had nothing to do with any settler or canMoveInto, it was just another logBBAI mistake.
in CvUnitAI::AI_lead() the bolded part was missing:
After I fix that, 1 round of AIAutoplay no longer causes any issues.Code:if( gUnitLogLevel > 2 ) { CvWString szString; getUnitAIString(szString, pBestUnit->AI_getUnitAIType()); logBBAI(" Great general %d for %S chooses to lead %S with UNITAI %S", getID(), GET_PLAYER(getOwner()).getCivilizationDescription(0), pBestUnit->getName(0).GetCString(), szString[B].GetCString()[/B] ); }
It's there: revision 99I have updated the better bug AI SVN on my comp but didn't see any revision to CvUnit, just CvPlayerAI.
if (bAttack)
{
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 02/21/10 jdog5000 */
/* */
/* Efficiency */
/************************************************************************************************/
// From Lead From Behind by UncutDragon
/* original code
CvUnit* pDefender = pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), this, true);
if (NULL != pDefender)
{
if (!canAttack(*pDefender))
{
return false;
}
}
*/ // modified
if (!pPlot->hasDefender(true, NO_PLAYER, getOwnerINLINE(), this, true))
return false;
/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/
}
Who knows if it's really getCiv that's crashingAs far as debugging goes I'm using MVS 2005 express. Also I can't seem to reproduce the crash with CvInitCore::getCiv, but I think it's still there. At least I can't get RevDCM to reproduce it, and did get it once in a LoR game recently but lost the save, and now I can't get either of them to do it... I feel strange wanting to have the game crash.
Actually we've been cruising through these, thanks alot for the helpSo, what issues/errors/bugs are left to squish?
boolean stuff .. NOT good. The Civ4 way to do this is to use a counter, like
- Get boolean leader traits to be removed properly with the CvPlayer::clearTraitBonuses function (currently integer values are subtracted, which clears them properly, but booleans do not). The problem is this is a bit complex because some leader traits also can be applied to the player from civics and buildings, so just wiping them may cause unintended problems. Probably will be somewhat trivial to code, just been focused on other more pressing critical bugs
bool CvPlayer::isNoForeignTrade() const
{
return (getNoForeignTradeCount() > 0);
}