Kailric
Jack of All Trades
Ok, I better see now what the problem is with the "doughnut" bug.
When a unit is reloaded it now will Process all it's promotions. The problem is that changeExtraVisibilityRange function also changes the Players plot sight count. So, if a Unit stays in one plot each time you save and reload that plot gains one extra sight count.
The first changeAdjacentSight removes the count, the second adds it. This Promotion needs to be adjusted so that it does not call the changeAdjacentSight when reloading.
This makes me wonder though if there are any other promotions that effect the game world as such. It's something that needs investigating.
Ok, I believe I have fixed this issue. I added a new bLoading boolean to skip changing adjacent sight when loading a game.
When I tested there were no more doughnuts
PS I also fixed it so that if a Trade Screen does not sell an item it will say "No Vendors" in the mouse over help text. Before it just listed the price as if it could be bought there.
PSS I've been real busy today. I also just fixed the "extra military profession bug" when changing plot professions and the military professions appear as well.
When a unit is reloaded it now will Process all it's promotions. The problem is that changeExtraVisibilityRange function also changes the Players plot sight count. So, if a Unit stays in one plot each time you save and reload that plot gains one extra sight count.
Code:
void CvUnit::changeExtraVisibilityRange(int iChange)
{
if (iChange != 0)
{
plot()->changeAdjacentSight(getTeam(), visibilityRange(), false, this, true);
m_iExtraVisibilityRange += iChange;
FAssert(getExtraVisibilityRange() >= 0);
plot()->changeAdjacentSight(getTeam(), visibilityRange(), true, this, true);
}
}
The first changeAdjacentSight removes the count, the second adds it. This Promotion needs to be adjusted so that it does not call the changeAdjacentSight when reloading.
This makes me wonder though if there are any other promotions that effect the game world as such. It's something that needs investigating.
Ok, I believe I have fixed this issue. I added a new bLoading boolean to skip changing adjacent sight when loading a game.
Code:
changeExtraVisibilityRange(int iChange, bool bLoading)
When I tested there were no more doughnuts

PS I also fixed it so that if a Trade Screen does not sell an item it will say "No Vendors" in the mouse over help text. Before it just listed the price as if it could be bought there.
PSS I've been real busy today. I also just fixed the "extra military profession bug" when changing plot professions and the military professions appear as well.