• R/O
  • HTTP
  • SSH
  • HTTPS

hengbandosx: Commit

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.


Commit MetaInfo

Revisionc02230e80f4eafddd5a5365030bb9837820582c3 (tree)
Zeit2021-01-26 22:36:09
Autordeskull <deskull@user...>
Commiterdeskull

Log Message

[Fix] #41316 賞金首生成時に判明したget_mon_num_prep(), get_mon_num()のバグ修正 / Fix get_mon_num_prep(), get_mon_num() found by process bounty selection.

  • get_mon_num_prep()時、条件を通った後ダンジョンごとのMONSTER_DIV修正でprop値が0になる部分を最低1保証.
  • 最低階層処理をget_mon_num()に回したことに伴う、prep値とtotal値の食い違いを修正.

Ändern Zusammenfassung

Diff

--- a/src/market/bounty.c
+++ b/src/market/bounty.c
@@ -289,7 +289,7 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old)
289289 r_ptr = &r_info[today_mon];
290290
291291 if (cheat_hear) {
292- msg_format("日替わり: %s ", r_ptr->name + r_name);
292+ msg_format("日替わり候補: %s ", r_ptr->name + r_name);
293293 }
294294
295295 if (r_ptr->flags1 & RF1_UNIQUE)
--- a/src/monster/monster-list.c
+++ b/src/monster/monster-list.c
@@ -134,9 +134,11 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_leve
134134
135135 /* Process probabilities */
136136 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,
139137 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,
140142 r_idx = table[i].index;
141143 r_ptr = &r_info[r_idx];
142144 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
162164 }
163165
164166 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);
166168 }
167169
168170 if (total <= 0)
--- a/src/monster/monster-util.c
+++ b/src/monster/monster-util.c
@@ -326,6 +326,7 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo
326326 int mon_num = 0;
327327 DEPTH lev_min = 127;
328328 DEPTH lev_max = 0;
329+ int total = 0;
329330 floor_type *floor_ptr = player_ptr->current_floor_ptr;
330331 for (int i = 0; i < alloc_race_size; i++) {
331332 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
346347 continue;
347348 }
348349
350+ if (entry->prob1 <= 0)
351+ continue;
352+
349353 mon_num++;
350354 if (lev_min > entry->level)
351355 lev_min = entry->level;
352356 if (lev_max < entry->level)
353357 lev_max = entry->level;
354358
359+
355360 entry->prob2 = entry->prob1;
356361 if (floor_ptr->dun_level && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest))
357362 && !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
359364 entry->prob2 = hoge / 64;
360365 if (randint0(64) < (hoge & 0x3f))
361366 entry->prob2++;
367+ if (entry->prob2 <= 0)
368+ entry->prob2 = 1;
362369 }
370+
371+ total += entry->prob2;
372+
363373 }
364374 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);
366376 }
367377 return 0;
368378 }
Show on old repository browser