X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=6ca1f876ac21a2b9e2acfaecbc09c8222acf6117;hb=4993be4c086b2a81dbf5af5a2c687cf2f0c93d21;hp=c47ce1d8ed4007cf8dc8e14b6c446a36e85794a8;hpb=bfa06be62d73a8ed7559b5344672d8a3f9bd947e;p=open-adventure.git diff --git a/misc.c b/misc.c index c47ce1d..6ca1f87 100644 --- a/misc.c +++ b/misc.c @@ -367,7 +367,7 @@ void MOVE(long object, long where) from=game.fixed[object-NOBJECTS]; else from=game.place[object]; - if (from > 0 && from <= 300) + if (from > 0 && !SPECIAL(from)) CARRY(object,from); DROP(object,where); } @@ -460,21 +460,21 @@ bool TSTBIT(long mask, int bit) 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 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 range * get_next_lcg_value() / lcgstate.m; + return range * get_next_lcg_value() / game.lcg_m; } long RNDVOC(long second, long force)