projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Coverage -- version command
[open-adventure.git]
/
misc.c
diff --git
a/misc.c
b/misc.c
index c907d123df56c0fdfae53662c8e09c1962260229..feebb4adcbdc48b16f06a359739dfc175bc47dfb 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-187,7
+187,7
@@
void vspeak(const char* msg, va_list ap)
} else {
long arg = va_arg(ap, long);
if (arg == -1)
} else {
long arg = va_arg(ap, long);
if (arg == -1)
- arg = 0;
+ arg = 0;
// LCOV_EXCL_LINE - don't think we can get here.
i++;
// Integer specifier. In order to accommodate the fact
// that PARMS can have both legitimate integers *and*
i++;
// Integer specifier. In order to accommodate the fact
// that PARMS can have both legitimate integers *and*
@@
-295,7
+295,7
@@
void rspeak(vocab_t i, ...)
va_end(ap);
}
va_end(ap);
}
-void echo_input(FILE* destination, c
har* input_prompt,
char* input)
+void echo_input(FILE* destination, c
onst char* input_prompt, const
char* input)
{
size_t len = strlen(input_prompt) + strlen(input) + 1;
char* prompt_and_input = (char*) xmalloc(len);
{
size_t len = strlen(input_prompt) + strlen(input) + 1;
char* prompt_and_input = (char*) xmalloc(len);
@@
-354,7
+354,7
@@
char* get_input()
echo_input(stdout, input_prompt, input);
if (logfp)
echo_input(stdout, input_prompt, input);
if (logfp)
- echo_input(logfp,
input_prompt
, input);
+ echo_input(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)
+ if (strcasecmp(word, motions[i].words.strs[j]) == 0
&& (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !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)
+ if (strcasecmp(word, actions[i].words.strs[j]) == 0
&& (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !oldstyle)
)
return (i);
}
}
return (i);
}
}
@@
-633,8
+633,8
@@
long atdwrf(long where)
return (at);
}
return (at);
}
-/* Utility routines (
SETBIT, TSTBIT
, set_seed, get_next_lcg_value,
- * randrange
, RNDVOC
) */
+/* Utility routines (
setbit, tstbit
, set_seed, get_next_lcg_value,
+ * randrange) */
long setbit(long bit)
/* Returns 2**bit for use in constructing bit-masks. */
long setbit(long bit)
/* Returns 2**bit for use in constructing bit-masks. */
@@
-652,6
+652,9
@@
void set_seed(long seedval)
/* Set the LCG seed */
{
game.lcg_x = (unsigned long) seedval % game.lcg_m;
/* Set the LCG seed */
{
game.lcg_x = (unsigned long) seedval % game.lcg_m;
+
+ // once seed is set, we need to generate the Z`ZZZ word
+ make_zzword(game.zzword);
}
unsigned long get_next_lcg_value(void)
}
unsigned long get_next_lcg_value(void)