You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a government with keyword reputation give an error.
Ex:
government "Test gov"
reputation
"player reputation" -1000
min -1000
max -1000
returns the following error:
Error: Requested token index (1) is out of bounds:
file (file location)
LXX: government "Test gov"
LXX: reputation
This is probably caused by error in Government.cpp (line 225), where during the handling of reputation "child" is used instead of "grand".
Code in question: for(const DataNode &grand : child) { const string &grandKey = grand.Token(0); bool hasGrandValue = grand.Size() >= 2; if(grandKey == "player reputation" && hasGrandValue) initialPlayerReputation = add ? initialPlayerReputation + child.Value(valueIndex) : child.Value(valueIndex); ...
This cause the code to look to a value that follows "reputation" instead of "player reputation". Consequently, the following code works with no error:
government "Test gov"
reputation -1000
"player reputation" -1000
min -1000
max -1000
Steps to Reproduce
Make a mode using the following government:
government "Test gov"
reputation
"player reputation" -1000
min -1000
max -1000
See error when loading the game
Expected Behavior
According to the wiki, the following is the expect behavior: reputation "player reputation" <initial-rep#> min <minimum-rep#> max <maximum-rep#>
Screenshots
No response
Link to save file
No response
Operating System
Windows
Game Source
GitHub Releases
Game Version
current
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Describe the bug
Creating a government with keyword reputation give an error.
Ex:
returns the following error:
Error: Requested token index (1) is out of bounds:
file (file location)
LXX: government "Test gov"
LXX: reputation
This is probably caused by error in Government.cpp (line 225), where during the handling of reputation "child" is used instead of "grand".
Code in question:
for(const DataNode &grand : child)
{
const string &grandKey = grand.Token(0);
bool hasGrandValue = grand.Size() >= 2;
if(grandKey == "player reputation" && hasGrandValue)
initialPlayerReputation = add ? initialPlayerReputation + child.Value(valueIndex) : child.Value(valueIndex);
...
This cause the code to look to a value that follows "reputation" instead of "player reputation". Consequently, the following code works with no error:
Steps to Reproduce
Expected Behavior
According to the wiki, the following is the expect behavior:
reputation
"player reputation" <initial-rep#>
min <minimum-rep#>
max <maximum-rep#>
Screenshots
No response
Link to save file
No response
Operating System
Windows
Game Source
GitHub Releases
Game Version
current
Additional Information
No response
The text was updated successfully, but these errors were encountered: