Skip to content

Commit

Permalink
A couple of small bugfixes (#194)
Browse files Browse the repository at this point in the history
* A couple of small bugfixes

Enable JSON reports for NO v7
Fix a couple of places where the JSON->text report wasn't quite right.
Fix a bug where the inactive turns handling was slightly wonky in the
JSON report.

* Add the json reports to the snapshots
  • Loading branch information
jt-traub authored Jun 3, 2024
1 parent db60888 commit 11f1ab2
Show file tree
Hide file tree
Showing 31 changed files with 394,757 additions and 4 deletions.
2 changes: 1 addition & 1 deletion faction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void Faction::build_json_report(json& j, Game *game, size_t **citems) {
j["administrative"]["show_unit_attitudes"] = (showunitattitudes != 0);

if(!password_unset) j["administrative"]["password"] = password->const_str();
if(Globals->MAX_INACTIVE_TURNS) {
if(Globals->MAX_INACTIVE_TURNS != -1) {
int cturn = game->TurnNumber() - lastorders;
if ((cturn >= (Globals->MAX_INACTIVE_TURNS - 3)) && !is_npc) {
cturn = Globals->MAX_INACTIVE_TURNS - cturn;
Expand Down
2 changes: 1 addition & 1 deletion neworigins/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static GameDefs g = {
200, // MIN_DESTROY_POINTS,
34, // MAX_DESTROY_PERCENT
1, // HALF_RIDING_BONUS
GameDefs::REPORT_FORMAT_TEXT, // REPORT_FORMAT
GameDefs::REPORT_FORMAT_TEXT | GameDefs::REPORT_FORMAT_JSON, // REPORT_FORMAT
5, // BATTLE_STOP_MOVE_PERCENT
};

Expand Down
25,852 changes: 25,852 additions & 0 deletions snapshot-tests/neworigins_turns/turn_0/report.1.json

Large diffs are not rendered by default.

Loading

0 comments on commit 11f1ab2

Please sign in to comment.