edit: Report ship and land unit commodity change properly
Print a message describing the actual change. Necessary to give the deity a chance to catch unexpected changes, e.g. a player unloading stuff right before the deity edits it, leaving fewer items than the deity intends to take. Watching out for such changes is especially important with non-interactive edit. Send bulletin to owner and report news exactly like the give command. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
5e4af4a6f0
commit
b99a116dd6
3 changed files with 27 additions and 0 deletions
|
@ -821,6 +821,12 @@ edit_ship(struct shpstr *ship, char *key, char *p)
|
||||||
case 'r':
|
case 'r':
|
||||||
ip = item_by_name(key);
|
ip = item_by_name(key);
|
||||||
arg = LIMIT_TO(arg, 0, mchr[ship->shp_type].m_item[ip->i_uid]);
|
arg = LIMIT_TO(arg, 0, mchr[ship->shp_type].m_item[ip->i_uid]);
|
||||||
|
divine_unit_change_quiet((struct empobj *)ship, ip->i_name,
|
||||||
|
arg != ship->shp_item[ip->i_uid],
|
||||||
|
"from %d to %d",
|
||||||
|
ship->shp_item[ip->i_uid], arg);
|
||||||
|
report_divine_gift(ship->shp_own, ip,
|
||||||
|
arg - ship->shp_item[ip->i_uid], prship(ship));
|
||||||
ship->shp_item[ip->i_uid] = arg;
|
ship->shp_item[ip->i_uid] = arg;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -925,6 +931,12 @@ edit_land(struct lndstr *land, char *key, char *p)
|
||||||
case 'r':
|
case 'r':
|
||||||
ip = item_by_name(key);
|
ip = item_by_name(key);
|
||||||
arg = LIMIT_TO(arg, 0, lchr[land->lnd_type].l_item[ip->i_uid]);
|
arg = LIMIT_TO(arg, 0, lchr[land->lnd_type].l_item[ip->i_uid]);
|
||||||
|
divine_unit_change_quiet((struct empobj *)land, ip->i_name,
|
||||||
|
arg != land->lnd_item[ip->i_uid],
|
||||||
|
"from %d to %d",
|
||||||
|
land->lnd_item[ip->i_uid], arg);
|
||||||
|
report_divine_gift(land->lnd_own, ip,
|
||||||
|
arg - land->lnd_item[ip->i_uid], prland(land));
|
||||||
land->lnd_item[ip->i_uid] = arg;
|
land->lnd_item[ip->i_uid] = arg;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -370,6 +370,7 @@ actor action victim times duration time
|
||||||
0 43 1 67 0 0
|
0 43 1 67 0 0
|
||||||
0 42 1 4 0 0
|
0 42 1 4 0 0
|
||||||
1 45 0 1 0 0
|
1 45 0 1 0 0
|
||||||
|
0 42 3 4 0 0
|
||||||
0 43 3 1 0 0
|
0 43 3 1 0 0
|
||||||
/config
|
/config
|
||||||
config treaty
|
config treaty
|
||||||
|
|
|
@ -995,15 +995,19 @@
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit s 2 m 0
|
Play#0 input edit s 2 m 0
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of cs cargo ship (#2) unchanged
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit s 3 m -1
|
Play#0 input edit s 3 m -1
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of cs cargo ship (#3) unchanged
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit s 4 m 50
|
Play#0 input edit s 4 m 50
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of cs cargo ship (#4) changed from 0 to 50
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit s 5 m 51
|
Play#0 input edit s 5 m 51
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of cs cargo ship (#5) changed from 0 to 50
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit p 2 e 0
|
Play#0 input edit p 2 e 0
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
@ -1115,15 +1119,19 @@
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit u 2 m 0
|
Play#0 input edit u 2 m 0
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of sup supply #2 unchanged
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit u 3 m -1
|
Play#0 input edit u 3 m -1
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of sup supply #3 unchanged
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit u 4 m 25
|
Play#0 input edit u 4 m 25
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of sup supply #4 changed from 0 to 25
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit u 5 m 26
|
Play#0 input edit u 5 m 26
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 military of sup supply #5 changed from 0 to 25
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input edit s 2 F ~
|
Play#0 input edit s 2 F ~
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
|
@ -1206,8 +1214,10 @@
|
||||||
Play#0 input M 2
|
Play#0 input M 2
|
||||||
Play#0 output Play#0 4 %c xxxxx -- thing value :
|
Play#0 output Play#0 4 %c xxxxx -- thing value :
|
||||||
Play#0 input m 1
|
Play#0 input m 1
|
||||||
|
Play#0 output Play#0 1 military of cs cargo ship (#0) changed from 0 to 1
|
||||||
Play#0 output Play#0 4 %c xxxxx -- thing value :
|
Play#0 output Play#0 4 %c xxxxx -- thing value :
|
||||||
Play#0 input f 1
|
Play#0 input f 1
|
||||||
|
Play#0 output Play#0 1 food of cs cargo ship (#0) changed from 0 to 1
|
||||||
Play#0 output Play#0 4 %c xxxxx -- thing value :
|
Play#0 output Play#0 4 %c xxxxx -- thing value :
|
||||||
Play#0 input
|
Play#0 input
|
||||||
Play#0 output Play#0 1 POGO (#0) cs cargo ship (#0)
|
Play#0 output Play#0 1 POGO (#0) cs cargo ship (#0)
|
||||||
|
@ -1639,6 +1649,10 @@
|
||||||
Play#0 output Play#0 1 sup supply #0 taken from you by an act of POGO!
|
Play#0 output Play#0 1 sup supply #0 taken from you by an act of POGO!
|
||||||
Play#0 output Play#0 1 sup supply #1 taken from you by an act of POGO!
|
Play#0 output Play#0 1 sup supply #1 taken from you by an act of POGO!
|
||||||
Play#0 output Play#0 1 sup supply #2 taken from you by an act of POGO!
|
Play#0 output Play#0 1 sup supply #2 taken from you by an act of POGO!
|
||||||
|
Play#0 output Play#0 1 POGO gave you 50 military in cs cargo ship (#4)
|
||||||
|
Play#0 output Play#0 1 POGO gave you 50 military in cs cargo ship (#5)
|
||||||
|
Play#0 output Play#0 1 POGO gave you 25 military in sup supply #4
|
||||||
|
Play#0 output Play#0 1 POGO gave you 25 military in sup supply #5
|
||||||
Play#0 output Play#0 1 Military reserves changed from 0 to 2147483647 by an act of POGO
|
Play#0 output Play#0 1 Military reserves changed from 0 to 2147483647 by an act of POGO
|
||||||
Play#0 output Play#0 1 Money changed from 0 to 2147483647 by an act of POGO
|
Play#0 output Play#0 1 Money changed from 0 to 2147483647 by an act of POGO
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue