Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoW S03, single player: defeat at start of turn 8, "the fog lifted to reveal a grim sight..." #2505

Closed
stevecotton opened this issue Feb 15, 2018 · 2 comments
Labels
Bug Issues involving unexpected behavior. Campaign (any) Deprecated tag, replaced with separate tags for each mainline campaign

Comments

@stevecotton
Copy link
Contributor

In LoW S03, the first 7 turns are a "hold until turns run out", and at the start of turn 8 there's a "time over" event which adds more turns, enlarges the map and gives you control of Kalenz' side.

In 3.13.11, the map doesn't grow, a WML error appears at the same time as the "the fog lifted to reveal a grim sight..." message, and as soon as the message disappears it's immediate defeat. Loading 3.13.11's turn 7 autosave in 3.13.10 and ending turn works fine, and loading 3.13.10's turn 8 autosave in 3.13.11 also seems ok.

There's a save file attached to https://forums.wesnoth.org/viewtopic.php?f=51&t=31609&p=623435#p623435 , which just needs you to end turn to recreate the bug. Github isn't happy with the file and won't let me attach it here.

The WML error (the 1844... number is 0xffffffffffffffff):

20180215 01:09:41 error scripting/lua: vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 7)
stack traceback:
[C]: in field 'set_village_owner'
lua/wml-tags.lua:511: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:200: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
[C]: in field 'fire_event'
lua/wml-tags.lua:164: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>

The Battle for Wesnoth version 1.13.11 (deb442b-Clean)
Running on Debian GNU/Linux unstable (sid)

Game paths

Data dir: /home/steve/development/other-source/wesnoth/build_from_tag_1.13.11/build/..
User config dir: /home/steve/.config/wesnoth1.13/
User data dir: /home/steve/.local/share/wesnoth/1.13
Saves dir: /home/steve/.local/share/wesnoth/1.13/saves
Add-ons dir: /home/steve/.local/share/wesnoth/1.13/data/add-ons
Cache dir: /home/steve/.cache/wesnoth

Libraries

Boost: 1.62
OpenSSL/libcrypto: 1.1.0g (runtime 1.1.0g)
Cairo: 1.15.10 (runtime 1.15.10)
Pango: 1.40.14 (runtime 1.40.14)
SDL: 2.0.7 (runtime 2.0.7)
SDL_image: 2.0.2 (runtime 2.0.2)
SDL_mixer: 2.0.2 (runtime 2.0.2)
SDL_ttf: 2.0.14 (runtime 2.0.14)
libpng: 1.6.34 (runtime 1.6.34)

Features

Experimental OpenMP support: no
PNG screenshots: yes
Lua console completion: yes
Legacy bidirectional rendering: yes
D-Bus notifications back-end: yes

@stevecotton
Copy link
Contributor Author

stevecotton commented Feb 15, 2018

In 6cd2a9b (the first version that git bisect chose for testing), the event almost works ok, and the scenario can continue to be played. However, during the start of turn 8, the sequence of dialogs finishes with:

  • How dare they break the treaty!
  • Cursed tree-shaggers and their filthy bows! We shall await the main army.
  • We have failed to relieve the defenders, and more orcish war-bands are arriving. All is lost!

The first two are expected, but the third is the new "time over" event that's added during the original "time over" event.

Edit: this is a different bug, 24e40cc is good for both bugs (the one in this comment was already fixed, the main bug in this issue wasn't introduced).

@Vultraz
Copy link
Member

Vultraz commented Feb 15, 2018

Above commit fixes it. The new time_over event being fired at the wrong time was a temporary regression introduced during my refactor of the game events system, and has since been fixed.

Thanks for finding this! :)

Vultraz added a commit that referenced this issue Feb 15, 2018
@gfgtdf pointed out that I didn't actually fix the underlying porblem that was causing
#2505 in 3e9654c: if new_side was 0, board().team_is_defeated(board().get_team(new_side))
would throw an out-of-range exception and the village would never be un-assigned from the
old side.

I'm totally refactored the function to be easier to understand and match the desired behavior.
@nemaara nemaara added Bug Issues involving unexpected behavior. Campaign (any) Deprecated tag, replaced with separate tags for each mainline campaign labels Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. Campaign (any) Deprecated tag, replaced with separate tags for each mainline campaign
Projects
None yet
Development

No branches or pull requests

3 participants