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:
@@ -2524,8 +2524,9 @@ breakobj(
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if obj is going to break, but don't actually break it.
|
||||
* Return 0 if the object isn't going to break, 1 if it is.
|
||||
* Check to see if obj (which has just hit hard something at speed, e.g.
|
||||
* thrown or dropped from height) is going to break, but don't actually
|
||||
* break it. Return 0 if the object isn't going to break, 1 if it is.
|
||||
*/
|
||||
boolean
|
||||
breaktest(struct obj *obj)
|
||||
|
||||
Reference in New Issue
Block a user