[Bug/Solution] Missing promotion icons in TechChooser

CyberChrist

You caught my attention
Joined
Dec 6, 2001
Messages
1,426
Location
The Matrix
There seems to be a consistant error in both official and modded versions of the CvTechChooser.py file (which generates the graphical presentation of the techtree).

When more than 1 promotion becomes available with the same tech CvTechChooser.py will make room for all the promotions under the tech, but it will ONLY show the icon for the last promotion.

Obviously this will only be noticeable in mods/scenarios where several promotions become availabe with the same tech (I discovered this bug while testing the excellent Fall from Heaven II mod).

Buggy code (in "Assets\Python\Screens\CvTechChooser.py"):
Code:
# Promotion Info
for j in range( gc.getNumPromotionInfos() ):
	if ( gc.getPromotionInfo(j).getTechPrereq() == i ):
		szPromotionButton = "Promotion" + str(i)
		screen.addDDSGFCAt( szPromotionButton, "TechList", gc.getPromotionInfo(j).getButton(), iX + fX, iY + Y_ROW, TEXTURE_SIZE, TEXTURE_SIZE, WidgetTypes.WIDGET_PEDIA_JUMP_TO_PROMOTION, j, -1, False )
		fX += X_INCREMENT


Change the following line(fix in bold):

szPromotionButton = "Promotion" + str(j)


I wonder if BtS also have this (minor) error? ;) :p
 
This error has been around for a long time (since 1.52 at least). I've tried reporting it firaxis but they did nothing. However I guess that it will be fixed in BtS as Military Science unlocks at least 2 promotions.
Too bad I only just became aware this bug - otherwise I could have provided the fix earlier. ;)
 
Too bad I only just became aware this bug - otherwise I could have provided the fix earlier. ;)

That's amazing! I just happen to have run into that very bug last week when adding new promotions to my mod. How timely (for me at least). Thanks for the fix!
 
Back
Top Bottom