Don't recreate unit with ;unit status command
This commit is contained in:
parent
1e575480a4
commit
19e173d1a7
1 changed files with 1 additions and 7 deletions
|
@ -420,10 +420,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_unit, child, use_undo, /*show*/, /*error_
|
|||
}
|
||||
}
|
||||
} else if (name == "status" ) {
|
||||
config cfg;
|
||||
i->write(cfg);
|
||||
resources::units->erase(loc);
|
||||
config& statuses = cfg.child_or_add("status");
|
||||
for (std::string status : utils::split(value)) {
|
||||
bool add = true;
|
||||
if (status.length() >= 1 && status[0] == '-') {
|
||||
|
@ -433,10 +429,8 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_unit, child, use_undo, /*show*/, /*error_
|
|||
if (status.empty()) {
|
||||
continue;
|
||||
}
|
||||
statuses[status] = add;
|
||||
i->set_state(status, add);
|
||||
}
|
||||
unit new_u(cfg, true);
|
||||
resources::units->add(loc, new_u);
|
||||
} else {
|
||||
config cfg;
|
||||
i->write(cfg);
|
||||
|
|
Loading…
Add table
Reference in a new issue