Aristos
Lightseeker
The following block of code uses the same code as DiploGameOverview, and it produces a negative counter for DoF and denouncements when speed is not standard:
The value GameDefines.DENUNCIATION_EXPIRATION_TIME is fixed (does not scale with game speed) and produces the error.
EDIT: either the reason above, or the counter function somehow does not reset to zero in some situations (maybe after a War Declaration?).
EDIT 2:
I fixed the error for the Global Relations mod using the following:
idem for the denouncement counter.
I assume this is what you wanted to implement into the Diplo Overview also. Please confirm.
Code:
--if isBNW then
local turnsleft;
if(Players[targetPid].GetDenouncedPlayerCounter ~= nil) then
turnsLeft = GameDefines.DENUNCIATION_EXPIRATION_TIME - Players[targetPid]:GetDenouncedPlayerCounter(thisPid);
tooltipData["denounce"][targetPid] = tooltipData["denounce"][targetPid] .. " (" .. turnsLeft .. ")";
end
--end
The value GameDefines.DENUNCIATION_EXPIRATION_TIME is fixed (does not scale with game speed) and produces the error.
EDIT: either the reason above, or the counter function somehow does not reset to zero in some situations (maybe after a War Declaration?).
EDIT 2:
I fixed the error for the Global Relations mod using the following:
Code:
local speed = GameInfo.GameSpeeds[ PreGame.GetGameSpeed() ];
local relationDuration = speed.RelationshipDuration;
......
turnsLeft = relationDuration - thisPlayer:GetDoFCounter(targetPid);
idem for the denouncement counter.
I assume this is what you wanted to implement into the Diplo Overview also. Please confirm.