We-the-People-civ4col-mod / Mod

This is the repository where the mod resides.
90 stars 37 forks source link

Assertion failed: CvPlot::changeVisibilityCount #898

Open devolution79 opened 1 year ago

devolution79 commented 1 year ago

Assert Failed

File: DLLSources.\CvPlot.cpp Line: 7550 Func: CvPlot::changeVisibilityCount Expression: getVisibilityCount(eTeam) >= 0 Message:


CvGameCoreDLL.dll!CvPlot::changeVisibilityCount(TeamTypes eTeam, int iChange, InvisibleTypes eSeeInvisible) Line 7550 C++ CvGameCoreDLL.dll!CvPlot::changeAdjacentSight(TeamTypes eTeam, int iRange, bool bIncrement, CvUnit * pUnit) Line 1567 C++ CvGameCoreDLL.dll!CvPlot::updateSight(bool bIncrement) Line 1743 C++ CvGameCoreDLL.dll!CvPlot::updateSeeFromSight(bool bIncrement) Line 1771 C++ CvGameCoreDLL.dll!CvPlot::setFeatureType(FeatureTypes eNewValue, int iVariety) Line 6038 C++ CvGameCoreDLL.dll!CvPlot::changeBuildProgress(BuildTypes eBuild, int iChange, TeamTypes eTeam) Line 8160 C++ CvGameCoreDLL.dll!CvUnit::build(BuildTypes eBuild) Line 7817 C++ CvGameCoreDLL.dll!CvSelectionGroup::groupBuild(BuildTypes eBuild) Line 3157 C++ CvGameCoreDLL.dll!CvSelectionGroup::continueMission(int iSteps) Line 1257 C++ CvGameCoreDLL.dll!CvSelectionGroup::autoMission() Line 525 C++ CvGameCoreDLL.dll!CvPlayerAI::AI_unitUpdate() Line 785 C++ CvGameCoreDLL.dll!CvGame::updateMoves() Line 5808 C++ CvGameCoreDLL.dll!CvGame::update() Line 1314 C++ [External Code] [Frames below may be incorrect and/or missing, no symbols loaded for Colonization.exe]

The argument iChange was -1 so the issue is the the visibility turning negative somehow!

It appears that the completion of a build caused a feature to be cleared and the assertion to trigger. Could it be related to fort / monastery completion on a previously forested plot ? (eBuild = 29)

devolution79 commented 1 year ago

Update: It was a fort that completed on a previously forested taiga plot

devolution79 commented 1 year ago

devolution AD-1639-visibility-assert.zip

Step to reproduce:

Wait for the fort on plot (7,12) 2 plots south of Salem to complete. (Add extra pioneers from WB if impatient) and the assertion will trigger upon completion

Build 41280e1

Nightinggale commented 1 year ago

Years ago we had a bug where storms could leave plots behind, which were no longer covered by fog of war. I fixed that and added code to recalculate the visibility cache on load as that fixed all existing savegames and would allow xml changes in existing games. Since this bug is this close to my code, I decided to self assign to this bug.