projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New dungeon compiler to gradually replace the existing one.
[open-adventure.git]
/
misc.c
diff --git
a/misc.c
b/misc.c
index 6f33146c2020ef74badb4ef85b8e89998fe334d7..a59ed5ff9a5e9b9f512f78f3dbcc005172b27348 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-460,21
+460,21
@@
bool TSTBIT(long mask, int bit)
void set_seed(long seedval)
/* Set the LCG seed */
{
void set_seed(long seedval)
/* Set the LCG seed */
{
-
lcgstate.x = (unsigned long) seedval % lcgstate.
m;
+
game.lcg_x = (unsigned long) seedval % game.lcg_
m;
}
unsigned long get_next_lcg_value(void)
/* Return the LCG's current value, and then iterate it. */
{
}
unsigned long get_next_lcg_value(void)
/* Return the LCG's current value, and then iterate it. */
{
- unsigned long old_x =
lcgstate.
x;
-
lcgstate.x = (lcgstate.a * lcgstate.x + lcgstate.c) % lcgstate.
m;
+ unsigned long old_x =
game.lcg_
x;
+
game.lcg_x = (game.lcg_a * game.lcg_x + game.lcg_c) % game.lcg_
m;
return old_x;
}
long randrange(long range)
/* Return a random integer from [0, range). */
{
return old_x;
}
long randrange(long range)
/* Return a random integer from [0, range). */
{
- return range * get_next_lcg_value() /
lcgstate.
m;
+ return range * get_next_lcg_value() /
game.lcg_
m;
}
long RNDVOC(long second, long force)
}
long RNDVOC(long second, long force)
@@
-541,7
+541,6
@@
void BUG(long num)
bool MAPLIN(FILE *fp)
{
bool MAPLIN(FILE *fp)
{
- long i, val;
bool eof;
/* Read a line of input, from the specified input source.
bool eof;
/* Read a line of input, from the specified input source.
@@
-577,7
+576,7
@@
bool MAPLIN(FILE *fp)
if (!eof) {
strncpy(rawbuf, cp, sizeof(rawbuf)-1);
linenoiseHistoryAdd(rawbuf);
if (!eof) {
strncpy(rawbuf, cp, sizeof(rawbuf)-1);
linenoiseHistoryAdd(rawbuf);
- strncat(rawbuf, "\n", sizeof(rawbuf)
-
1);
+ strncat(rawbuf, "\n", sizeof(rawbuf)
- strlen(rawbuf) -
1);
linenoiseFree(cp);
}
}
linenoiseFree(cp);
}
}
@@
-624,8
+623,8
@@
bool MAPLIN(FILE *fp)
* and is not changed thereafter unless the routines on this page choose
* to do so. */
LNLENG=0;
* and is not changed thereafter unless the routines on this page choose
* to do so. */
LNLENG=0;
- for (i=1; i<=(long)sizeof(INLINE) && INLINE[i]!=0; i++) {
- val=INLINE[i];
+ for (
long
i=1; i<=(long)sizeof(INLINE) && INLINE[i]!=0; i++) {
+
long
val=INLINE[i];
INLINE[i]=ascii_to_advent[val];
if (INLINE[i] != 0)
LNLENG=i;
INLINE[i]=ascii_to_advent[val];
if (INLINE[i] != 0)
LNLENG=i;