more GOLDOBJ
The earlier patch made sure that bribe() didn't pass an invalid value to money2mon(). This one changes money2mon() so that if some other code else does so, reporting the impossible situation won't be followed by a splitobj panic. Most of this patch is reformatting though.
This commit is contained in:
14
src/minion.c
14
src/minion.c
@@ -186,19 +186,19 @@ struct monst *mtmp;
|
||||
} else if (offer >= u.ugold) {
|
||||
You("give %s all your gold.", mon_nam(mtmp));
|
||||
offer = u.ugold;
|
||||
} else You("give %s %ld %s.", mon_nam(mtmp), offer,
|
||||
currency(offer));
|
||||
|
||||
} else {
|
||||
You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer));
|
||||
}
|
||||
u.ugold -= offer;
|
||||
mtmp->mgold += offer;
|
||||
#else
|
||||
} else if (offer >= umoney) {
|
||||
You("give %s all your gold.", mon_nam(mtmp));
|
||||
offer = umoney;
|
||||
} else You("give %s %ld %s.", mon_nam(mtmp), offer,
|
||||
currency(offer));
|
||||
|
||||
money2mon(mtmp, offer);
|
||||
} else {
|
||||
You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer));
|
||||
}
|
||||
(void) money2mon(mtmp, offer);
|
||||
#endif
|
||||
flags.botl = 1;
|
||||
return(offer);
|
||||
|
||||
Reference in New Issue
Block a user