mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 22:18:56 +00:00
Implemented FR #13321: added "unit advances=N"...
...command to debug console to immediately level-up active unit N times
This commit is contained in:
parent
55ae886f8d
commit
93269b7fbc
@ -62,6 +62,8 @@ Version 1.7.0-svn:
|
||||
plus some other unwanted changes there (bug #13243)
|
||||
* Making the game return to the add-on install dialog just before
|
||||
installing one, and with its entry selected
|
||||
* Implemented FR #13321: added "unit advances=N" command to debug console
|
||||
to immediately level-up selected unit N times
|
||||
* WML Engine:
|
||||
* Added [show_objectives] tag (part of bug #13042)
|
||||
* Made moveto events set $x2,$y2 to the source hex. (bug #13140)
|
||||
|
@ -3020,10 +3020,18 @@ private:
|
||||
command_failed("Invalid alignment: '" + value + "', needs to be one of lawful, neutral or chaotic.");
|
||||
return;
|
||||
}
|
||||
config cfg;
|
||||
i->second.write(cfg);
|
||||
cfg[name] = value;
|
||||
i->second = unit(&menu_handler_.units_,&menu_handler_.map_,&menu_handler_.status_,&menu_handler_.teams_,cfg);
|
||||
if (name == "advances" ){
|
||||
int int_value = lexical_cast<int>(value);
|
||||
for (int levels=0; levels<int_value; levels++) {
|
||||
i->second.get_experience( i->second.max_experience() - i->second.experience() );
|
||||
dialogs::advance_unit(menu_handler_.map_, menu_handler_.units_,i->first,*menu_handler_.gui_);
|
||||
}
|
||||
} else {
|
||||
config cfg;
|
||||
i->second.write(cfg);
|
||||
cfg[name] = value;
|
||||
i->second = unit(&menu_handler_.units_,&menu_handler_.map_,&menu_handler_.status_,&menu_handler_.teams_,cfg);
|
||||
}
|
||||
menu_handler_.gui_->invalidate(i->first);
|
||||
menu_handler_.gui_->invalidate_unit();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user