- takedamage() should end instantly if object is aleady dead.

This commit is contained in:
Rob Pearce 2016-06-09 17:11:47 +10:00
parent 8730225c6e
commit c6f3f3f9bd
2 changed files with 8 additions and 1 deletions

2
data.c
View File

@ -2490,7 +2490,7 @@ void initobjects(void) {
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_IMPORTANT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_IMPORTANT, B_TRUE, NA, NA, NULL);
addot(OT_VSTAIRSDOWN, "metal hatch leading down", "A study metal hatchway set into the floor.", MT_METAL, 3000, OC_DFEATURE, SZ_HUGE); addot(OT_VSTAIRSDOWN, "metal hatch leading down", "A sturdy metal hatchway set into the floor.", MT_METAL, 3000, OC_DFEATURE, SZ_HUGE);
addflag(lastot->flags, F_GLYPH, C_METAL, '>', NA, NULL); addflag(lastot->flags, F_GLYPH, C_METAL, '>', NA, NULL);
addflag(lastot->flags, F_STAIRS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_STAIRS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "staircase"); addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "staircase");

View File

@ -10687,6 +10687,9 @@ int obpropsmatch(object_t *a, object_t *b) {
flag_t *obrestrictsmovement(object_t *o, lifeform_t *lf) { flag_t *obrestrictsmovement(object_t *o, lifeform_t *lf) {
flag_t *f; flag_t *f;
if (isdeadob(o)) return NULL;
f = hasflag(o->flags, F_RESTRICTMOVEMENT); f = hasflag(o->flags, F_RESTRICTMOVEMENT);
if (f) { if (f) {
if (!lf) return NULL; if (!lf) return NULL;
@ -14908,6 +14911,10 @@ int real_takedamage(object_t *o, int howmuch, int damtype, int wantannounce, lif
flag_t *hpflag, *f; flag_t *hpflag, *f;
int damtaken = 0; int damtaken = 0;
if (isdeadob(o)) {
return howmuch;
}
// some checks need to happen before // some checks need to happen before
// making sure the damage will happen. // making sure the damage will happen.
// for example, even if an object is // for example, even if an object is