The master and develop branches track hengband.
OS X development happens on the macos-1-6-2, macos-2-2-1, and macos-develop branches.
Revision | c02230e80f4eafddd5a5365030bb9837820582c3 (tree) |
---|---|
Zeit | 2021-01-26 22:36:09 |
Autor | deskull <deskull@user...> |
Commiter | deskull |
[Fix] #41316 賞金首生成時に判明したget_mon_num_prep(), get_mon_num()のバグ修正 / Fix get_mon_num_prep(), get_mon_num() found by process bounty selection.
@@ -289,7 +289,7 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old) | ||
289 | 289 | r_ptr = &r_info[today_mon]; |
290 | 290 | |
291 | 291 | if (cheat_hear) { |
292 | - msg_format("日替わり: %s ", r_ptr->name + r_name); | |
292 | + msg_format("日替わり候補: %s ", r_ptr->name + r_name); | |
293 | 293 | } |
294 | 294 | |
295 | 295 | if (r_ptr->flags1 & RF1_UNIQUE) |
@@ -134,9 +134,11 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_leve | ||
134 | 134 | |
135 | 135 | /* Process probabilities */ |
136 | 136 | for (i = 0; i < alloc_race_size; i++) { |
137 | - if (table[i].level < min_level) continue; | |
138 | - if (max_level < table[i].level) break; // sorted by depth array, | |
139 | 137 | table[i].prob3 = 0; |
138 | + if (table[i].level < min_level) | |
139 | + continue; | |
140 | + if (max_level < table[i].level) | |
141 | + break; // sorted by depth array, | |
140 | 142 | r_idx = table[i].index; |
141 | 143 | r_ptr = &r_info[r_idx]; |
142 | 144 | if (!(option & GMN_ARENA) && !chameleon_change_m_idx) { |
@@ -162,7 +164,7 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_leve | ||
162 | 164 | } |
163 | 165 | |
164 | 166 | if (cheat_hear) { |
165 | - msg_format(_("モンスター第3次候補数:%d(%d-%dF) ", "monster third selection:%d(%d-%dF) "), mon_num, min_level, max_level); | |
167 | + msg_format(_("モンスター第3次候補数:%d(%d-%dF)%d ", "monster third selection:%d(%d-%dF)%d "), mon_num, min_level, max_level, total); | |
166 | 168 | } |
167 | 169 | |
168 | 170 | if (total <= 0) |
@@ -326,6 +326,7 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo | ||
326 | 326 | int mon_num = 0; |
327 | 327 | DEPTH lev_min = 127; |
328 | 328 | DEPTH lev_max = 0; |
329 | + int total = 0; | |
329 | 330 | floor_type *floor_ptr = player_ptr->current_floor_ptr; |
330 | 331 | for (int i = 0; i < alloc_race_size; i++) { |
331 | 332 | alloc_entry *entry = &alloc_race_table[i]; |
@@ -346,12 +347,16 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo | ||
346 | 347 | continue; |
347 | 348 | } |
348 | 349 | |
350 | + if (entry->prob1 <= 0) | |
351 | + continue; | |
352 | + | |
349 | 353 | mon_num++; |
350 | 354 | if (lev_min > entry->level) |
351 | 355 | lev_min = entry->level; |
352 | 356 | if (lev_max < entry->level) |
353 | 357 | lev_max = entry->level; |
354 | 358 | |
359 | + | |
355 | 360 | entry->prob2 = entry->prob1; |
356 | 361 | if (floor_ptr->dun_level && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest)) |
357 | 362 | && !restrict_monster_to_dungeon(player_ptr, entry->index) && !player_ptr->phase_out) { |
@@ -359,10 +364,15 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo | ||
359 | 364 | entry->prob2 = hoge / 64; |
360 | 365 | if (randint0(64) < (hoge & 0x3f)) |
361 | 366 | entry->prob2++; |
367 | + if (entry->prob2 <= 0) | |
368 | + entry->prob2 = 1; | |
362 | 369 | } |
370 | + | |
371 | + total += entry->prob2; | |
372 | + | |
363 | 373 | } |
364 | 374 | if (cheat_hear) { |
365 | - msg_format(_("モンスター第2次候補数:%d(%d-%dF) ", "monster second selection:%d(%d-%dF) "), mon_num, lev_min, lev_max); | |
375 | + msg_format(_("モンスター第2次候補数:%d(%d-%dF)%d ", "monster second selection:%d(%d-%dF)&d "), mon_num, lev_min, lev_max, total); | |
366 | 376 | } |
367 | 377 | return 0; |
368 | 378 | } |