fix editor cannot add starting location for > 9 players.

previously attempting to place a starting location for side 10 or higher would result in a "invalid location id" error.

(cherry-picked from commit cbf078a030)
This commit is contained in:
gfgtdf 2018-08-13 20:41:16 +02:00 committed by Severin Glöckner
parent 6f66e0d52f
commit a0eaf4e7a4

View file

@ -263,7 +263,7 @@ void location_palette::adjust_size(const SDL_Rect& target)
button_add_.reset(new location_palette_button(video(), SDL_Rect{ target.x , bottom -= button_y, target.w - 10, button_height }, _("Add"), [this]() {
std::string newid;
if (gui2::dialogs::edit_text::execute(_("New Location Identifier"), "", newid)) {
static const boost::regex valid_id("[a-zA-Z_]+");
static const boost::regex valid_id("[a-zA-Z0-9_]+");
if(boost::regex_match(newid, valid_id)) {
add_item(newid);
}