Reduce code duplication in extrinsics-protect-items code
The same checks were being repeated for every damage type; this sends them through two centralised functions (one for checking whether an extrinsic blocks a specific instance of item destruction and one for the enlightenment message), so that new mechanisms of item destruction prevention will need to change only one point in the code.
This commit is contained in:
@@ -3582,7 +3582,8 @@ extern void melt_ice_away(union any *, long);
|
||||
extern int zap_over_floor(coordxy, coordxy, int, boolean *, boolean, short);
|
||||
extern void fracture_rock(struct obj *);
|
||||
extern boolean break_statue(struct obj *);
|
||||
extern boolean u_adtyp_resistance_obj(int);
|
||||
extern int u_adtyp_resistance_obj(int);
|
||||
extern boolean inventory_resistance_check(int);
|
||||
extern char *item_what(int);
|
||||
extern void destroy_item(int, int);
|
||||
extern int destroy_mitem(struct monst *, int, int);
|
||||
|
||||
Reference in New Issue
Block a user