projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved application settings to settings_t struct
[open-adventure.git]
/
misc.c
diff --git
a/misc.c
b/misc.c
index feebb4adcbdc48b16f06a359739dfc175bc47dfb..5e7692149ed88697579374b023cd6facb21f05ae 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-325,7
+325,7
@@
char* get_input()
{
// Set up the prompt
char input_prompt[] = "> ";
{
// Set up the prompt
char input_prompt[] = "> ";
- if (!prompt)
+ if (!
settings.
prompt)
input_prompt[0] = '\0';
// Print a blank line if game.blklin tells us to.
input_prompt[0] = '\0';
// Print a blank line if game.blklin tells us to.
@@
-353,8
+353,8
@@
char* get_input()
if (!isatty(0))
echo_input(stdout, input_prompt, input);
if (!isatty(0))
echo_input(stdout, input_prompt, input);
- if (logfp)
- echo_input(logfp, "", input);
+ if (
settings.
logfp)
+ echo_input(
settings.
logfp, "", input);
return (input);
}
return (input);
}
@@
-459,7
+459,7
@@
int get_motion_vocab_id(const char* word)
{
for (int i = 0; i < NMOTIONS; ++i) {
for (int j = 0; j < motions[i].words.n; ++j) {
{
for (int i = 0; i < NMOTIONS; ++i) {
for (int j = 0; j < motions[i].words.n; ++j) {
- if (strcasecmp(word, motions[i].words.strs[j]) == 0 && (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !oldstyle))
+ if (strcasecmp(word, motions[i].words.strs[j]) == 0 && (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !
settings.
oldstyle))
return (i);
}
}
return (i);
}
}
@@
-485,7
+485,7
@@
int get_action_vocab_id(const char* word)
{
for (int i = 0; i < NACTIONS; ++i) {
for (int j = 0; j < actions[i].words.n; ++j) {
{
for (int i = 0; i < NACTIONS; ++i) {
for (int j = 0; j < actions[i].words.n; ++j) {
- if (strcasecmp(word, actions[i].words.strs[j]) == 0 && (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !oldstyle))
+ if (strcasecmp(word, actions[i].words.strs[j]) == 0 && (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !
settings.
oldstyle))
return (i);
}
}
return (i);
}
}
@@
-680,14
+680,6
@@
void make_zzword(char zzword[6])
zzword[5] = '\0';
}
zzword[5] = '\0';
}
-void datime(long* d, long* t)
-{
- struct timeval tv;
- gettimeofday(&tv, NULL);
- *d = (long) tv.tv_sec;
- *t = (long) tv.tv_usec;
-}
-
// LCOV_EXCL_START
void bug(enum bugtype num, const char *error_string)
{
// LCOV_EXCL_START
void bug(enum bugtype num, const char *error_string)
{