edit: Report unit loss and gain properly for unit key 'O'
Print a message describing the actual change. Necessary to give the deity a chance to catch unexpected changes, e.g. a player boarding a ship right before the deity edits it. Watching out for such changes is especially important with non-interactive edit. Code already sends bulletins. Also report news. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
6e260f7f5e
commit
ccd4368679
3 changed files with 18 additions and 10 deletions
|
@ -754,14 +754,13 @@ edit_unit(struct empobj *unit, char *key, char *p,
|
|||
case 'O':
|
||||
if (arg < 0 || arg >= MAXNOC)
|
||||
return RET_SYN;
|
||||
if (arg == unit->own)
|
||||
break;
|
||||
if (unit->own && unit->own != player->cnum)
|
||||
wu(0, unit->own, "%s taken from you by an act of %s!\n",
|
||||
unit_nameof(unit), cname(player->cnum));
|
||||
if (arg && arg != player->cnum)
|
||||
wu(0, arg, "%s given to you by an act of %s!\n",
|
||||
unit_nameof(unit), cname(player->cnum));
|
||||
divine_unit_change_quiet(unit, "Owner", arg != unit->own,
|
||||
"from %s to %s",
|
||||
prnatid(unit->own), prnatid(arg));
|
||||
if (arg != unit->own) {
|
||||
report_god_takes("", unit_nameof(unit), unit->own);
|
||||
report_god_gives("", unit_nameof(unit), arg);
|
||||
}
|
||||
unit->own = arg;
|
||||
break;
|
||||
case 'L':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue