*/
void do_cmd_visuals(void)
{
- char i;
+ int i;
char tmp[160];
char buf[1024];
bool need_redraw = FALSE;
*/
static void confirm_use_force(bool browse_only)
{
- INVENTORY_IDX item;
char which;
COMMAND_CODE code;
/* Get the item index */
if (repeat_pull(&code) && (code == INVEN_FORCE))
{
- item = (INVENTORY_IDX)code;
browse_only ? do_cmd_mind_browse() : do_cmd_mind();
return;
}
int old_chp = p_ptr->chp;
char death_message[1024];
- char tmp[80];
+ char tmp[1024];
int warning = (p_ptr->mhp * hitpoint_warn / 10);
char b2 = ']';
char f = ' ';
- static char tmp[10];
+ static char tmp[16];
/* Initial */
s = (*sp);
"S_UNIQUE"
};
+#if 0
/*!
* モンスター特性トークン(発動型能力3) /
* Monster race flags
"XXXA3X30",
"XXXA3X31",
};
+#endif
+#if 0
/*!
* モンスター特性トークン(発動型能力4) /
* Monster race flags
"XXXA4X30",
"XXXA4X31",
};
+#endif
/*!
else
m_ptr->smart = 0;
- if (z_older_than(10, 4, 5))
+ if (z_older_than(10, 4, 5)) {
m_ptr->exp = 0;
- else
- tmp32u = 0;
+ } else {
rd_u32b(&tmp32u);
m_ptr->exp = tmp32u;
+ }
if (z_older_than(10, 2, 2))
{
size_t inlen = len;
size_t outlen = len * 2;
char *kanji = malloc(outlen);
- char *sp = str; char *kp = kanji;
- size_t n = iconv(cd, &sp, &inlen, &kp, &outlen);
+ char *sp; char *kp = kanji;
+ char sbuf[1024];
+ my_strcpy(sbuf, str, sizeof(sbuf));
+ sp = sbuf;
+ iconv(cd, &sp, &inlen, &kp, &outlen);
iconv_close(cd);
XmbDrawImageString(Metadpy->dpy, Infowin->win, Infofnt->info,
/* Wizards get extra info */
if (p_ptr->wizard)
{
- char buf[6];
+ char buf[16];
sprintf(buf, "%d", r_idx);
*/
void bolt(MONSTER_IDX m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
{
- BIT_FLAGS flg;
+ BIT_FLAGS flg = 0;
bool learnable = spell_learnable(m_idx);
switch (target_type)
monster_type *t_ptr = NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- monster_race *tr_ptr = NULL;
u32b f4, f5, f6;
bool see_m = is_seen(m_ptr);
bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
- bool see_t;
- bool see_either;
bool pet = is_pet(m_ptr);
bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
/* OK -- we've got a target */
y = t_ptr->fy;
x = t_ptr->fx;
- tr_ptr = &r_info[t_ptr->r_idx];
/* Forget old counter attack target */
reset_target(m_ptr);
/* Choose a spell to cast */
thrown_spell = spell[randint0(num)];
- see_t = is_seen(t_ptr);
- see_either = (see_m || see_t);
-
if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
/* Check for spell failure (inate attacks never fail) */
*/
HIT_POINT spell_RF4_BREATH(int GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, IDX t_idx, int TARGET_TYPE)
{
- HIT_POINT dam, ms_type, drs_type;
+ HIT_POINT dam, ms_type, drs_type = 0;
cptr type_s;
bool smart_learn_aux = TRUE;
monster_type *m_ptr = &m_list[m_idx];
smart_learn_aux = FALSE;
break;
default:
+ /* Do not reach here */
+ dam = 0;
+ type_s = _("不明", "Unknown");
+ ms_type = MS_BR_ACID;
+ smart_learn_aux = FALSE;
break;
}
*/
HIT_POINT spell_RF6_SPECIAL_B(POSITION y, POSITION x, MONSTER_IDX m_idx, IDX t_idx, int TARGET_TYPE)
{
- HIT_POINT dam;
+ HIT_POINT dam = -1;
monster_type *m_ptr = &m_list[m_idx];
monster_type *t_ptr = &m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
bool make_object(object_type *j_ptr, BIT_FLAGS mode)
{
int prob, base;
- DEPTH obj_level;
/* Chance of "special object" */
}
}
- obj_level = k_info[j_ptr->k_idx].level;
- if (object_is_fixed_artifact(j_ptr)) obj_level = a_info[j_ptr->name1].level;
-
if (cheat_peek) object_mention(j_ptr);
/* Success */
choice = (always_show_list || use_menu) ? ESCAPE:1;
while (!flag)
{
- bool able[22];
+ bool able[22] = {0};
if( choice==ESCAPE ) choice = ' ';
else if( !get_com(out_val, &choice, FALSE) )break;
*/
struct power_desc_type
{
- char name[40];
+ char name[80];
PLAYER_LEVEL level;
int cost;
int stat;
/* Save the player info XXX XXX XXX */
sprintf(the_score.uid, "%7u", player_uid);
sprintf(the_score.sex, "%c", (p_ptr->psex ? 'm' : 'f'));
- sprintf(the_score.p_r, "%2d", p_ptr->prace);
- sprintf(the_score.p_c, "%2d", p_ptr->pclass);
- sprintf(the_score.p_a, "%2d", p_ptr->pseikaku);
+ sprintf(the_score.p_r, "%2d", MIN(p_ptr->prace, MAX_RACES));
+ sprintf(the_score.p_c, "%2d", MIN(p_ptr->pclass, MAX_CLASS));
+ sprintf(the_score.p_a, "%2d", MIN(p_ptr->pseikaku, MAX_SEIKAKU));
/* Save the level and such */
- sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
+ sprintf(the_score.cur_lev, "%3d", MIN((u16b)p_ptr->lev, 999));
sprintf(the_score.cur_dun, "%3d", (int)dun_level);
- sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
+ sprintf(the_score.max_lev, "%3d", MIN((u16b)p_ptr->max_plv, 999));
sprintf(the_score.max_dun, "%3d", (int)max_dlv[dungeon_type]);
/* Save the cause of death (31 chars) */
/* Save the player info XXX XXX XXX */
sprintf(the_score.uid, "%7u", player_uid);
sprintf(the_score.sex, "%c", (p_ptr->psex ? 'm' : 'f'));
- sprintf(the_score.p_r, "%2d", p_ptr->prace);
- sprintf(the_score.p_c, "%2d", p_ptr->pclass);
- sprintf(the_score.p_a, "%2d", p_ptr->pseikaku);
+ sprintf(the_score.p_r, "%2d", MIN(p_ptr->prace, MAX_RACES));
+ sprintf(the_score.p_c, "%2d", MIN(p_ptr->pclass, MAX_CLASS));
+ sprintf(the_score.p_a, "%2d", MIN(p_ptr->pseikaku, MAX_SEIKAKU));
/* Save the level and such */
- sprintf(the_score.cur_lev, "%3d", (int)p_ptr->lev);
+ sprintf(the_score.cur_lev, "%3d", MIN((u16b)p_ptr->lev, 999));
sprintf(the_score.cur_dun, "%3d", (int)dun_level);
- sprintf(the_score.max_lev, "%3d", (int)p_ptr->max_plv);
+ sprintf(the_score.max_lev, "%3d", MIN((u16b)p_ptr->max_plv, 999));
sprintf(the_score.max_dun, "%3d", (int)max_dlv[dungeon_type]);
/* Hack -- no cause of death */
}
/* New Message Length */
- n = (buf ? strlen(buf) : 0);
+ n = strlen(buf);
/* Memorize the message */
if (character_generated) message_add(buf);
char ppp[80], tmp_val[40];
/* Prompt */
- sprintf(ppp, "Dungeon Turn (0-%ld): ", dungeon_turn_limit);
+ sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
/* Default */
- sprintf(tmp_val, "%ld", dungeon_turn);
+ sprintf(tmp_val, "%ld", (long)dungeon_turn);
/* Query */
if (!get_string(ppp, tmp_val, 10)) return (FALSE);
{
byte attr = TERM_WHITE;
- char text[5];
+ char text[16];
/* Repeating */
if (command_rep)
bool innocent = TRUE, thief = FALSE;
int i;
int expdam;
- int dealt_damage;
(void)COPY(&exp_mon, m_ptr, monster_type);
/* Genocided by chaos patron */
if (!m_idx) return TRUE;
- /* Remember dealt_damage before this attack*/
- dealt_damage = m_ptr->dealt_damage;
-
/* Hurt it */
m_ptr->hp -= dam;
#ifdef RNG_DEVICE
FILE *fp = fopen(RNG_DEVICE, "r");
+ int n;
do {
- fread(Rand_state, sizeof(Rand_state[0]), 4, fp);
- } while ((Rand_state[0] | Rand_state[1] | Rand_state[2] | Rand_state[3]) == 0);
+ n = fread(Rand_state, sizeof(Rand_state[0]), 4, fp);
+ } while (n != 4 || (Rand_state[0] | Rand_state[1] | Rand_state[2] | Rand_state[3]) == 0);
fclose(fp);