mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-06 11:31:14 +00:00
Test whether a cell has only one widget.
Before multiple widgets in a cell were silently ignored, now it gives an error and aborts the game.
This commit is contained in:
parent
04fbd760ca
commit
60cac119de
@ -390,6 +390,13 @@ tbuilder_grid::tbuilder_grid(const config& cfg) :
|
||||
col_grow_factor.push_back(lexical_cast_default<unsigned>((**col_itor)["grow_factor"]));
|
||||
}
|
||||
|
||||
if((**col_itor).all_children().size() != 1) {
|
||||
ERR_G_P << "Grid cell has " << (**col_itor).all_children().size()
|
||||
<< " children instead of 1, aborting. Config :\n"
|
||||
<< **col_itor;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
if((**col_itor).child("button")) {
|
||||
widgets.push_back(new tbuilder_button(*((**col_itor).child("button"))));
|
||||
} else if((**col_itor).child("label")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user