stolenrays
Deity
- Joined
- Aug 2, 2009
- Messages
- 2,061
V1.7 is uploaded and adds the RevDCM CounterEspionage Automation.
void CvUnit::doTurn()
{
PROFILE("CvUnit::doTurn()")
FAssertMsg(!isDead(), "isDead did not return false as expected");
FAssertMsg(getGroup() != NULL, "getGroup() is not expected to be equal with NULL");
[B]PlayerTypes eOrigOwner;[/B]
testPromotionReady();
[B]eOrigOwner = getOriginalOwner()[/B];
if (isPrisoner())
{
[B]if (!GET_PLAYER(eOrigOwner).isAlive())[/B]
{
setOriginalOwner(NO_PLAYER);
}
}
Well, a crash somewhere else is a positive step right?I added a isSpy check to that function and also added some of your checks/changes to some other things. It helped, but I still got a crash somewhere later.
bool CvPlayer::isAlive() const
{
return m_bAlive;
}
Are you getting any exception messages?Hmm. I'm still getting a CTD when it checks .isAlive() in CvUnit.cpp. Now, the CTD only happens when a spy is performing a mission. What do you think Lemon?
Are you getting any exception messages?
Have you added to/changed the Python for the spy missions in any way? Or anything related to isAlive() in Python? The problem may not be in the SDK.
Just looking at all the possibilities.
void CvUnit::doTurn()
{
PROFILE("CvUnit::doTurn()")
FAssertMsg(!isDead(), "isDead did not return false as expected");
FAssertMsg(getGroup() != NULL, "getGroup() is not expected to be equal with NULL");
testPromotionReady();
PlayerTypes eOriginalOwner;
eOriginalOwner = getOriginalOwner();
if (isSpy())
{
if (isPrisoner())
{
if (!GET_PLAYER(eOriginalOwner).isAlive())
{
setOriginalOwner(NO_PLAYER);
}
}
}
bool CvUnit::isPrisoner() const
{
PlayerTypes eOriginalOwner;
eOriginalOwner = getOriginalOwner();
if (eOriginalOwner == NO_PLAYER)
{
return false;
}
else
{
if (eOriginalOwner != getOwnerINLINE())
{
if (GET_PLAYER(eOriginalOwner).isAlive())
{
return true;
}
}
}
return false;
}
if (!GET_PLAYER([B][COLOR="Red"](PlayerTypes)[/COLOR][/B] eOrigOwner).isAlive())
{
setOriginalOwner(NO_PLAYER);
}
--- CvSelectionGroupOriginal.cpp 2012-08-19 03:33:59.000000000 +0200
+++ CvSelectionGroup.cpp 2013-04-30 12:09:33.048757321 +0200
@@ -1178,7 +1178,8 @@
/* Advanced Automations */
/************************************************************************************************/
case MISSION_ESPIONAGE_SLEEP:
-
+ bDelete = true;
+ break;
/************************************************************************************************/
/* Afforess END */
/************************************************************************************************/