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

Editor player menu crashes on setting tribes #4296

Closed
frankystone opened this issue Sep 28, 2020 · 3 comments · Fixed by #4428
Closed

Editor player menu crashes on setting tribes #4296

frankystone opened this issue Sep 28, 2020 · 3 comments · Fixed by #4428
Labels
bug Something isn't working crashes or hangs Assert failures, sigsegv, crashes, Widelands hangs, … editor Editor-specific features tribes Buildings, wares, workers, ships, ... ui User interface
Milestone

Comments

@frankystone
Copy link
Contributor

To Reproduce

  1. Create a new random map
  2. Press 'p' to bring up the player menu
  3. Try to change 'Random Tribe' with a tribe

Result:

widelands: /home/kaputtnik/Quellcode/widelands-repo/widelands/src/editor/ui_menus/player_menu.cc:301: void EditorPlayerMenu::player_tribe_clicked(size_t): Assertion `tribename.empty() || eia().egbase().tribes().tribe_exists(tribename)' failed.
Abgebrochen (Speicherabzug geschrieben)

Version:

  • OS: archlinux
  • Widelands Version: [4e9992f@master] (Debug)
@frankystone frankystone added bug Something isn't working crashes or hangs Assert failures, sigsegv, crashes, Widelands hangs, … ui User interface labels Sep 28, 2020
@Noordfrees Noordfrees added this to the v1.0 milestone Sep 28, 2020
@Noordfrees Noordfrees added editor Editor-specific features tribes Buildings, wares, workers, ships, ... labels Sep 28, 2020
@Noordfrees
Copy link
Member

Noordfrees commented Sep 28, 2020

This also happens when pressing P directly after starting the editor and choosing a tribe for a player.

@gunchleoc

@Noordfrees Noordfrees changed the title Random map generator crashes on setting tribes Editor player menu crashes on setting tribes Sep 28, 2020
@matthiakl
Copy link
Member

Is it necessary to have the tribes loaded for the editor? Without the assert, everything seems to work, but I don't have much experience with the editor.

Otherwise, all tribes have to be loaded during editor startup. This was removed in PR #3693 .

--- a/src/editor/editorinteractive.cc
+++ b/src/editor/editorinteractive.cc
@@ -956,6 +956,7 @@ void EditorInteractive::run_editor(const std::string& filename, const std::strin
                egbase.create_loader_ui({"editor"}, true, kEditorSplashImage);
                eia.load_world_units();
                egbase.tribes();
+               egbase.load_all_tribes();
 
                {
                        if (filename.empty()) {

@gunchleoc
Copy link
Contributor

We should use TribeBasicInfo::tribe_exists(const std::string& tribename); which loads just the basic info from Lua.

We do this in GameSettings somewhere too, where the info is stored in a variable so we don't have to rerun the Lua script for every check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crashes or hangs Assert failures, sigsegv, crashes, Widelands hangs, … editor Editor-specific features tribes Buildings, wares, workers, ships, ... ui User interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants