Merge fire-based erosion to common codepaths.
This finally eliminates all direct increases of `oeroded` and `oeroded2` and moves them all to go via `erode_obj()`. They are still manipulated directly in a few places, but not to erode objects. This now merges the `fire_damage()` function to a common codepath, used for items on lava and burning oil, but fire needs more work. There is still a duplication between `destroy_item()` and `fire_damage()`; the two codepaths should eventually be merged in some manner so that there is only one codepath to say "an object was affected by fire". This path might require some parameters, such as whether the fire will just erode objects or burn them outright, but that can happen another day.
This commit is contained in:
4
src/do.c
4
src/do.c
@@ -184,7 +184,7 @@ const char *verb;
|
||||
newsym(x,y);
|
||||
return TRUE;
|
||||
} else if (is_lava(x, y)) {
|
||||
return fire_damage(obj, FALSE, FALSE, x, y);
|
||||
return fire_damage(obj, FALSE, x, y);
|
||||
} else if (is_pool(x, y)) {
|
||||
/* Reasonably bulky objects (arbitrary) splash when dropped.
|
||||
* If you're floating above the water even small things make
|
||||
@@ -201,7 +201,7 @@ const char *verb;
|
||||
map_background(x, y, 0);
|
||||
newsym(x, y);
|
||||
}
|
||||
return water_damage(obj, NULL, FALSE) == 3;
|
||||
return water_damage(obj, NULL, FALSE) == ER_DESTROYED;
|
||||
} else if (u.ux == x && u.uy == y &&
|
||||
(t = t_at(x,y)) != 0 && uteetering_at_seen_pit(t)) {
|
||||
if (Blind && !Deaf)
|
||||
|
||||
Reference in New Issue
Block a user