@Fermongu: Ok, I'll get that fixed.
@Thunderbrd: I was trying to add a python hotkey that would call CyGame().toggleDebugMode(), without having to have "chipotle" cheat level in the ini file.
Ctrl+Alt+Shift+D
But this only toggled debug mode halfway.
CvGame.cpp has two global variables called:
With "Chipotle", both are set to true.
The problem is that the function CyGame().isDebugMode() returns m_bDebugModeCache as its answer.
Meaning no python debug functions will turn on by using CyGame().toggleDebugMode().
Let's look at the relevant bit of code that is prcessed in the dll when CyGame.toggleDebugMode is called:
I believe gDLL->getChtLvl() > 0 will never be True without "chipotle" set in the ini cheat setting.
I don't really see why debugMode cannot be turned on properly without the "chipotle" cheat active...
chipotle does a lot of other stuff that is quite irrelevant to the debug mode.
There's two way's to go about this
1. m_bDebugModeCache is only used by CyGame().isDebugMode(), why not let that python function return the value of m_bDebugMode instead?
2. Change CvGame::updateDebugModeCache() to simply be: "m_bDebugModeCache = m_bDebugMode;" with no if/else statements at all.
Method number 1 would have the least risk of unforeseen consequences as I know pretty well what python does with the result from CyGame().isDebugMode(), and the exe doesn't care what that python function return one bit.
Method number 2 is risky if the exe somehow is privy to, and uses the value stored in the dll variables m_bDebugModeCache and m_bDebugMode. It is hard to know what the exe code needs those values to be in relation to the "chipotle" cheat.
I could of course make the python debug mode 100% internal within python, so that neither dll nor exe would be aware that python code is running in debug mode, but this would require me to change all the python related debug mode code to the new system, which is a lot of work.
@Thunderbrd: I was trying to add a python hotkey that would call CyGame().toggleDebugMode(), without having to have "chipotle" cheat level in the ini file.
Ctrl+Alt+Shift+D
But this only toggled debug mode halfway.
CvGame.cpp has two global variables called:
m_bDebugMode
m_bDebugModeCache
Without "Chipotle", only m_bDebugMode is set to true.m_bDebugModeCache
With "Chipotle", both are set to true.
The problem is that the function CyGame().isDebugMode() returns m_bDebugModeCache as its answer.
Meaning no python debug functions will turn on by using CyGame().toggleDebugMode().
Let's look at the relevant bit of code that is prcessed in the dll when CyGame.toggleDebugMode is called:
Code:
void CvGame::updateDebugModeCache()
{
if ((gDLL->getChtLvl() > 0) || (gDLL->GetWorldBuilderMode()))
{
m_bDebugModeCache = m_bDebugMode;
}
else
{
m_bDebugModeCache = false;
}
}
I don't really see why debugMode cannot be turned on properly without the "chipotle" cheat active...
chipotle does a lot of other stuff that is quite irrelevant to the debug mode.
There's two way's to go about this
1. m_bDebugModeCache is only used by CyGame().isDebugMode(), why not let that python function return the value of m_bDebugMode instead?
2. Change CvGame::updateDebugModeCache() to simply be: "m_bDebugModeCache = m_bDebugMode;" with no if/else statements at all.
Method number 1 would have the least risk of unforeseen consequences as I know pretty well what python does with the result from CyGame().isDebugMode(), and the exe doesn't care what that python function return one bit.
Method number 2 is risky if the exe somehow is privy to, and uses the value stored in the dll variables m_bDebugModeCache and m_bDebugMode. It is hard to know what the exe code needs those values to be in relation to the "chipotle" cheat.
If the exe doesn't use the dll variable m_bDebugModeCache at all then the variable could be removed from the dll completely. (I have a feeling the exe does know and use that variable though)
I could of course make the python debug mode 100% internal within python, so that neither dll nor exe would be aware that python code is running in debug mode, but this would require me to change all the python related debug mode code to the new system, which is a lot of work.
Last edited: