OSDN Git Service

[Refactor] #37353 world_type を world.c/h へ移動。
[hengband/hengband.git] / src / util.c
index f4ad16b..5913bf0 100644 (file)
 /* Purpose: Angband utilities -BEN- */
 
 #include "angband.h"
+#include "util.h"
 #include "monsterrace-hook.h"
+#include "view-mainwindow.h"
+#include "quest.h"
+#include "floor.h"
+#include "world.h"
 
 
 static int num_more = 0;
@@ -1139,8 +1144,6 @@ void text_to_ascii(char *buf, concptr str)
                {
                        /* Skip the backslash */
                        str++;
-
-                       /* Paranoia */
                        if (!(*str)) break;
 
                        /* Macro Trigger */
@@ -1681,7 +1684,7 @@ void select_floor_music(void)
        /* No sound */
        if (!use_music) return;
 
-       if(ambush_flag)
+       if(p_ptr->ambush_flag)
        {
                play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_AMBUSH);
                return;
@@ -2783,7 +2786,7 @@ void msg_print(concptr msg)
        char *t;
        char buf[1024];
 
-       if (world_monster) return;
+       if (current_world_ptr->timewalk_m_idx) return;
 
        /* Hack -- Reset */
        if (!msg_flag) {
@@ -2809,8 +2812,6 @@ void msg_print(concptr msg)
 
        /* No message */
        if (!msg) return;
-
-       /* Paranoia */
        if (n > 1000) return;
 
        /* Copy it */
@@ -3570,8 +3571,6 @@ bool askfor(char *buf, int len)
 bool get_string(concptr prompt, char *buf, int len)
 {
        bool res;
-
-       /* Paranoia */
        msg_print(NULL);
 
        /* Display prompt */
@@ -3618,8 +3617,6 @@ bool get_check_strict(concptr prompt, BIT_FLAGS mode)
                handle_stuff();
                num_more = 0;
        }
-
-       /* Paranoia */
        msg_print(NULL);
 
        if (!rogue_like_commands)
@@ -3721,7 +3718,6 @@ bool get_check_strict(concptr prompt, BIT_FLAGS mode)
  */
 bool get_com(concptr prompt, char *command, bool z_escape)
 {
-       /* Paranoia */
        msg_print(NULL);
 
        /* Display a prompt */
@@ -3799,8 +3795,6 @@ QUANTITY get_quantity(concptr prompt, QUANTITY max)
                /* Use that prompt */
                prompt = tmp;
        }
-
-       /* Paranoia */
        msg_print(NULL);
 
        /* Display prompt */
@@ -4540,8 +4534,6 @@ void request_command(int shopping)
                        continue;
                }
 
-
-               /* Paranoia */
                if (!cmd) continue;
 
 
@@ -4602,8 +4594,6 @@ void request_command(int shopping)
                concptr s;
 
                object_type *o_ptr = &inventory[i];
-
-               /* Skip non-objects */
                if (!o_ptr->k_idx) continue;
 
                /* No inscription */
@@ -4777,8 +4767,6 @@ int get_keymap_dir(char ch)
                        }
                }
        }
-
-       /* Paranoia */
        if (d == 5) d = 0;
 
        /* Return direction */
@@ -5274,8 +5262,6 @@ size_t my_strcpy(char *buf, concptr src, size_t bufsize)
 
        size_t len = strlen(src);
        size_t ret = len;
-
-       /* Paranoia */
        if (bufsize == 0) return ret;
 
        /* Truncate */
@@ -5563,3 +5549,4 @@ int inkey_special(bool numpad_cursor)
        /* Return normal keycode */
        return (int)((unsigned char)key);
 }
+