Skip to content

Game Over: make the AI resign and overwhelming advantage options work - #5880

Open
moss-orbit-9f339e wants to merge 1 commit into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:upstream/game-over-modoptions
Open

moss-orbit-9f339e wants to merge 1 commit into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:upstream/game-over-modoptions

Conversation

@moss-orbit-9f339e

Copy link
Copy Markdown
Contributor

The lobby options "Disable AI Resignation" and "Disable Overwhelming Advantage" never worked. Spring.GetModOptions() gives every value as a string, but the code compares the value with the number 1. This change reads both options with tobool, as the file already does for commends and noelo.

Testing (Windows, RTX 3080, master ee8950e):

  • Live game with two AI teams without builders and disable_ai_team_resign=1: without this change, both teams resign at frame 69. With this change, the game continues to frame 12,600.
  • Nuclear Winter replay at full graphics: no Lua errors. The checksums, unit counts and screenshot are the same as master.
  • I did not test the overwhelming-advantage option in a game. It uses the same tobool read.
  • I watched these test runs.

AI disclosure: Claude Code wrote this change and the tests. I reviewed the change.

…s booleans

Spring.GetModOptions() returns every value as a string (the engine pushes
each option with lua_pushsstring), so disable_ai_team_resign == 1 and
disable_overwhelming_advantage == 1 were always false and both bool
modoptions (ModOptions.lua, type='bool') had no effect since they were added.
Read them with tobool like the commends and noelo options above: "1" or
"true" enables, "0", "false" or unset leaves the defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant