B01006 - containers hitting the floor
<Someone> noted that if you dropped a box while levitating, nothing would break. This is true for sacks too, which shouldn't be immune either. Throwing didn't break contained objects either, not mentioned in his report. Refactored out the code in kick_object that handled damage for objects contained in normal containers and added calls in hitfloor and throwit. kick_object still only calls it for boxes, but other callers will call it for any object letting it decide if damage is required. BoH objects aren't affected, since traditionally the inside of the BoH is "somewhere else".
This commit is contained in:
@@ -340,6 +340,7 @@ register struct obj *obj;
|
||||
if (hero_breaks(obj, u.ux, u.uy, TRUE)) return;
|
||||
if (ship_object(obj, u.ux, u.uy, FALSE)) return;
|
||||
dropy(obj);
|
||||
if (!u.uswallow) container_impact_dmg(obj);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1088,6 +1089,8 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
|
||||
newsym(bhitpos.x,bhitpos.y);
|
||||
if (obj_sheds_light(obj))
|
||||
vision_full_recalc = 1;
|
||||
if (!IS_SOFT(levl[bhitpos.x][bhitpos.y].typ))
|
||||
container_impact_dmg(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user