変愚蛮怒のメインリポジトリです
Revision | e6b9119f9c7fd59893133a5a9eff306b42f31d9e (tree) |
---|---|
Time | 2013-03-17 19:31:42 |
Author | dis- <dis-@0568...> |
Commiter | dis- |
fix bug of calc_expect_crit. return too small value for no critical case.
@@ -3116,13 +3116,16 @@ static void town_history(void) | ||
3116 | 3116 | |
3117 | 3117 | s16b calc_expect_crit(int weight, int plus, int dam, s16b meichuu, bool dokubari) |
3118 | 3118 | { |
3119 | - u32b i,k, num; | |
3119 | + u32b k, num; | |
3120 | + int i; | |
3120 | 3121 | |
3121 | 3122 | if(dokubari) return dam; |
3122 | 3123 | |
3123 | 3124 | i = weight + (meichuu * 3 + plus * 5) + (p_ptr->lev * 3); |
3125 | + if (i < 0) i = 0; | |
3126 | + | |
3124 | 3127 | k = weight; |
3125 | - num=0; | |
3128 | + num = 0; | |
3126 | 3129 | |
3127 | 3130 | if (k < 400) num += (2 * dam + 5) * (400 - k); |
3128 | 3131 | if (k < 700) num += (2 * dam + 10) * (MIN(700, k + 650) - MAX(400, k)); |