CvGlobals.cpp crash issue..maybe?

An assert fail from this part of the code is still giving me a CTD. It seems to be in connection with an early game unit, as it always CTD's near the beginning of the game...I just cannot seem to find anything wrong with anything though!!

If any one has any helpful thoughts i would be much obliged as my development is basically dead if i cannot fix this!

Code:
CvUnitInfo& CvGlobals::getUnitInfo(UnitTypes eUnitNum)
{
	FAssert([COLOR="Red"]eUnitNum > -1[/COLOR]);
	FAssert(eUnitNum < GC.getNumUnitInfos());
	return *(m_paUnitInfo[eUnitNum]);
}
 
Since it is looking for a unit with a unit type of -1 (or lower, but probably -1) I'd suggest looking at two things.

First is your Python. Make sure any unit type mentioned in there actually exists ("UNIT_WEREZOMBIE" or whatever). No typos allowed.

Second, I'm not sure but it might be an issue with drafting. If it is possible to try to draft a unit before there is any unit that can be drafted I'm not sure what happens but it causes problems. This issue can come up even if there is no civic currently available to anybody that allows drafting. Possibly via Python since I seem to recall that somewhere the BUG Python it is checking for what unit can currently be drafted. In regular BtS you can draft a warrior so there is never a time when there is no unit that can be drafted. I recall running into this in FFP where in the very early game there was no unit type most of the civs can build that can be drafted. Ah, found it - this is my note about this in my notes on adding BUG to FFP and fixing various issues:
Code:
Fixed Known Issue 6: Domestic Advisor draft unit display bug
- The calculatePotentialConscriptUnit function was blindly using
	the return value from CyCity.getConscriptUnit() which results
	in a value of -1 (UNIT_NONE) when there is no unit that can be
	drafted. This is causes the getUnitInfo that is run with that
	value to fail. So now calculatePotentialConscriptUni checks what
	the unit is and if it it not valid it returns an empty string.
	
	Modifed File:
		Assets\Python\Screens\CvCustomizableDomesticAdvisor.py
So it was calling getUnitInfo with a value of -1, like you are probably seeing.
 
Grrr I was really hoping it was the conscription issue you talked about, but I set iconscription to 1 for the starting unit but it still CTD's

I have removed some unit references from python but it still CTD's, I am now going to check the rest of the python.....SO much python!...

BugGameUtils.py
self._setDefault("getConscriptUnitType", UnitTypes.NO_UNIT)

could it have something to do with this?

Well I fixed all of the unit references in python that I could find...I really thought I had it that time, but it still CTD's....

what is it that I need to change in the CvCustomizableDomesticAdvisor.py file?
 
Back
Top Bottom