edit: Make unit owner change away from POGO work
Units owned by POGO are not in use. Giving a unit to POGO destroys it. The opposite doesn't work, however: the unit prewrite hooks give it right back to POGO, because efficiency is below the minimum. Make it work by also increasing efficiency to minimum. Note that you can't use this to create a unit that doesn't already exist in the respective file. That's because edit's second argument selects from existing objects only. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
3404b9ce7f
commit
2936e07f41
4 changed files with 33 additions and 2 deletions
|
@ -759,6 +759,11 @@ edit_unit(struct empobj *unit, char *key, char *p,
|
|||
report_god_takes("", unit_nameof(unit), unit->own);
|
||||
report_god_gives("", unit_nameof(unit), arg);
|
||||
}
|
||||
if (arg && unit->effic < mineff) {
|
||||
divine_unit_change_quiet(unit, "Efficiency", 1,
|
||||
"from %d to %d", unit->effic, mineff);
|
||||
unit->effic = mineff;
|
||||
}
|
||||
unit->own = arg;
|
||||
break;
|
||||
case 'L':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue