summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 08:11:52 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 08:11:52 +0000
commit0ffe1315339223ae3b68b79ff2a68fbb3665a865 (patch)
tree8c8be438e0787879fdb07c622b09399236e5c822
parent0a69a524938f8c559947685b901abdb22043925b (diff)
downloadcrawl-ref-0ffe1315339223ae3b68b79ff2a68fbb3665a865.tar.gz
crawl-ref-0ffe1315339223ae3b68b79ff2a68fbb3665a865.zip
Apply Haran's fixes (r6577) to 0.4.1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6582 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/changes.stone_soup2
-rw-r--r--crawl-ref/source/fight.cc2
-rw-r--r--crawl-ref/source/food.cc15
-rw-r--r--crawl-ref/source/message.cc2
-rw-r--r--crawl-ref/source/mon-util.cc7
5 files changed, 23 insertions, 5 deletions
diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup
index 58f5706872..099eb532f1 100644
--- a/crawl-ref/docs/changes.stone_soup
+++ b/crawl-ref/docs/changes.stone_soup
@@ -11,7 +11,9 @@ Disclaimer: These are merely the highlights, not an exhaustive list of changes.
* Fixed DOS problems with long file names.
* Fixed targetting prompts being ignored or having the wrong result.
* Fixed vampire bat jewellery exploit.
+* Fixed secondary monster attacks being branded according to their weapon.
* Fixed kills by hell effects counting as player kills.
+* Fixed persistent --more-- in wizard mode.
* Fixed cold/fire always destroying all potions/scrolls on the floor.
* Fixed Portal Projectile not handling throwing nets or branded ammo correctly.
* Fixed friendly pickup toggle being inappropriately disallowed.
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index f5821ebb84..5f6b47c671 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3858,6 +3858,8 @@ void melee_attack::mons_perform_attack_rounds()
if (attack_number > 0 && attacker == defender)
break;
+ init_attack();
+
const mon_attack_def attk = mons_attack_spec(atk, attack_number);
if (attk.type == AT_NONE)
{
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 15577ae30e..8aac6e201f 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -1916,9 +1916,9 @@ bool causes_rot(const item_def &food)
}
// Returns 1 for herbivores, -1 for carnivores and 0 for either.
-static int _player_likes_food_type(int food_type)
+static int _player_likes_food_type(int type)
{
- switch (food_type)
+ switch (static_cast<food_type>(type))
{
case FOOD_BREAD_RATION:
case FOOD_PEAR:
@@ -1941,10 +1941,19 @@ static int _player_likes_food_type(int food_type)
case FOOD_CHUNK:
case FOOD_MEAT_RATION:
case FOOD_SAUSAGE:
+ case FOOD_BEEF_JERKY:
return -1;
+
+ case FOOD_HONEYCOMB:
+ case FOOD_ROYAL_JELLY:
+ return 0;
+
+ case NUM_FOODS:
+ mpr("Bad food type", MSGCH_ERROR);
+ return 0;
}
- // Anything missing?
+ mprf(MSGCH_ERROR, "Couldn't handle food type: %d");
return 0;
}
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index 8cb38c1102..fd9d2e0d9f 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -830,7 +830,7 @@ void mesclr( bool force )
New_Message_Count = 0;
// If no messages, return.
- if (!any_messages())
+ if (!any_messages() && !force)
return;
if (!force && Options.delay_message_clear)
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 0a80500e7e..a664852bcd 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3190,7 +3190,12 @@ item_def *monsters::launcher()
item_def *monsters::weapon(int which_attack)
{
- if (which_attack > 1)
+ const mon_attack_def attk = mons_attack_spec(this, which_attack);
+ if ( attk.type != AT_HIT )
+ return NULL;
+
+ // Even/odd attacks use main/offhand weapon
+ if ( which_attack > 1 )
which_attack &= 1;
// This randomly picks one of the wielded weapons for monsters that can use