diff options
-rw-r--r-- | crawl-ref/source/externs.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 29 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 9 |
5 files changed, 22 insertions, 25 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 871605da97..5d91734a35 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -290,9 +290,8 @@ struct item_def item_def() : base_type(OBJ_UNASSIGNED), sub_type(0), plus(0), plus2(0), special(0L), colour(0), flags(0L), quantity(0), x(0), y(0), link(NON_ITEM), slot(0), orig_place(0), - orig_monnum(0) + orig_monnum(0), inscription() { - inscription.clear(); } void clear() diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index da54eeaf4f..dcab9825a2 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1963,54 +1963,55 @@ void update_corpses(double elapsedTime) for (int c = 0; c < MAX_ITEMS; c++) { - if (mitm[c].quantity < 1) + item_def &it = mitm[c]; + + if (!is_valid_item(it)) continue; - if (mitm[c].base_type != OBJ_CORPSES && mitm[c].base_type != OBJ_FOOD) + if (it.base_type != OBJ_CORPSES && it.base_type != OBJ_FOOD) { continue; } - if (mitm[c].base_type == OBJ_CORPSES - && mitm[c].sub_type > CORPSE_SKELETON) + if (it.base_type == OBJ_CORPSES + && it.sub_type > CORPSE_SKELETON) { continue; } - if (mitm[c].base_type == OBJ_FOOD && mitm[c].sub_type != FOOD_CHUNK) + if (it.base_type == OBJ_FOOD && it.sub_type != FOOD_CHUNK) { continue; } - if (rot_time >= mitm[c].special) + if (rot_time >= it.special) { - if (mitm[c].base_type == OBJ_FOOD) + if (it.base_type == OBJ_FOOD) { destroy_item(c); } else { - if (mitm[c].sub_type == CORPSE_SKELETON - || !mons_skeleton( mitm[c].plus )) + if (it.sub_type == CORPSE_SKELETON + || !mons_skeleton( it.plus )) { destroy_item(c); } else { - mitm[c].sub_type = CORPSE_SKELETON; - mitm[c].special = 200; - mitm[c].colour = LIGHTGREY; + it.sub_type = CORPSE_SKELETON; + it.special = 200; + it.colour = LIGHTGREY; } } } else { ASSERT(rot_time < 256); - mitm[c].special -= rot_time; + it.special -= rot_time; } } - int fountain_checks = (int)(elapsedTime / 1000.0); if (random2(1000) < (int)(elapsedTime) % 1000) fountain_checks += 1; diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index e43e33ec8e..66ebef55e0 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1111,6 +1111,7 @@ bool random_near_space(int ox, int oy, int &tx, int &ty, bool allow_adjacent, while ((!see_grid(tx, ty) && restrict_LOS) || grd[tx][ty] < DNGN_SHALLOW_WATER || mgrd[tx][ty] != NON_MONSTER + || (tx == you.x_pos && ty == you.y_pos) || (!allow_adjacent && distance(ox, oy, tx, ty) <= 2)); return (tries < 150); diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index ebed0c633a..3a60fda754 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -802,8 +802,11 @@ void monster_teleport(struct monsters *monster, bool instan, bool silent) newy = 10 + random2(GYM - 20); // don't land on top of another monster - if (mgrd[newx][newy] != NON_MONSTER) + if (mgrd[newx][newy] != NON_MONSTER + || (newx == you.x_pos && newy == you.y_pos)) + { continue; + } if (monster_habitable_grid(monster, grd[newx][newy])) break; diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index fd03b4a2c7..9673214744 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -337,7 +337,7 @@ int animate_dead( int power, int corps_beh, int corps_hit, int actual ) int objl = igrd[adx][ady]; int hrg = 0; - //this searches all the items on the ground for a corpse + // This searches all the items on the ground for a corpse while (objl != NON_ITEM) { if (mitm[objl].base_type == OBJ_CORPSES) @@ -363,13 +363,6 @@ int animate_dead( int power, int corps_beh, int corps_hit, int actual ) if (number_raised > 0) { mpr("The dead are walking!"); - //else - // mpr("The dark energy consumes the dead!"); - no, this - // means that no corpses were found. Better to say: - // mpr("You receive no reply."); - //jmf: Why do I have to get an uninformative message when some random - //jmf: monster fails to do something? - // IMHO there's too much noise already. } return number_raised; |