| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Deity
Join Date: Jul 2004
Location: Earth
Posts: 2,386
|
Would this apply to FfH II?
I saw Afforess posted this in the 3.19 bug thread. Since FfH also allows increase to capacity, I wanted to report it here.
Best wishes, Breunor Jdog5000, I've found the cause of a rare-ish CTD, and a possible fix for it. In CvPlayerAI.cpp, in the function "TechTypes CvPlayerAI::AI_bestTech(int iMaxPathLength, bool bIgnoreCost, bool bAsync, TechTypes eIgnoreTech, AdvisorTypes eIgnoreAdvisor) const" There is a section where in rare instances, the formula divides by 0. The code in question is this section: Code: int iNewCapacity = kLoopUnit.getMoves() * kLoopUnit.getCargoSpace(); int iOldCapacity = GC.getUnitInfo(eExistingUnit).getMoves() * GC.getUnitInfo(eExistingUnit).getCargoSpace(); iAssaultValue += (800 * (iNewCapacity - iOldCapacity)) / iOldCapacity; In Vanilla BTS, the iOldCapacity is never 0, but in Rise of Mankind (and possibly other mods), there is a promotion that adds an extra cargo space to ships, even to ships without preexisting cargo space. If the AI gave this promotion to a ship without cargo space, the iOldCapacity would be 0, and the function would divide by 0. I fixed this by changing that segment of code into this: Code: int iNewCapacity = kLoopUnit.getMoves() * kLoopUnit.getCargoSpace(); int iOldCapacity = GC.getUnitInfo(eExistingUnit).getMoves() * GC.getUnitInfo(eExistingUnit).getCargoSpace(); if (iOldCapacity <= 0) {iAssaultValue += (600 * iNewCapacity);} else {iAssaultValue += (800 * (iNewCapacity - iOldCapacity)) / iOldCapacity;} That fixed the CTD and allow me to go to the next turn. I would appreciate it if this fix made it into the next UP. __________________ |
|
|
|
|
|
#2 |
|
Warlord
Join Date: Apr 2009
Posts: 271
|
I came across this problem when modding the naval AI. It does apply to FfH, but the current AI never encounters it because it doesn't know how to use ships properly.
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ffh Nes Ii | Immaculate | Never Ending Stories | 2767 | Nov 08, 2011 10:15 PM |
| Speeding up FfH II | Wyrmhero | Civ4 - Fall from Heaven | 15 | May 13, 2008 01:26 PM |
| Ffh Ii | The_Astrologer | Civ4 - Fall from Heaven | 2 | Sep 05, 2007 06:52 AM |
| FFH II Game of the Month... | Bigben34 | Civ4 - Fall from Heaven | 1 | May 30, 2007 09:45 PM |
| Ffh II | spekkio | Civ4 - Macintosh | 8 | Jul 16, 2006 09:55 AM |