X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=actions.c;h=0c79f3a917bd2a06f2f4759ac681b8d739b5504d;hb=1f7a1bc8fdfb8f8bd7cdd5d4161f9e54220a7ed2;hp=01a373bad99e36ad0b35fa1745fd2afaf97c575c;hpb=e2ebc24114d277a16dda480c80e48dd5d5d1ff64;p=open-adventure.git diff --git a/actions.c b/actions.c index 01a373b..0c79f3a 100644 --- a/actions.c +++ b/actions.c @@ -4,7 +4,9 @@ #include "database.h" /* Limit visibility of ugly globals. Eventually these should go away. */ -extern long K, SPK, WD1, WD1X, WD2, WD2X; +extern long K, WD1, WD1X, WD2, WD2X; + +static long SPK; /* This should go away too */ /* * Action handlers. Eventually we'll do lookup through a method table @@ -337,10 +339,10 @@ static int discard(long obj, bool just_do_it) if (obj == RUBY)SPK=221; RSPEAK(SPK); if (SPK != 220) { - K=2-game.prop[RUG]; - game.prop[RUG]=K; - if (K == 2)K=PLAC[SAPPH]; - MOVE(RUG+NOBJECTS,K); + int k = 2-game.prop[RUG]; + game.prop[RUG] = k; + if (k == 2) k = PLAC[SAPPH]; + MOVE(RUG+NOBJECTS, k); } } } else if (obj == COINS && HERE(VEND)) { @@ -370,9 +372,10 @@ static int discard(long obj, bool just_do_it) if (game.prop[VASE] != 0)game.fixed[VASE]= -1; } } - K=LIQUID(); - if (K == obj)obj=BOTTLE; - if (obj == BOTTLE && K != 0)game.place[K]=0; + int k = LIQUID(); + if (k == obj)obj=BOTTLE; + if (obj == BOTTLE && k != 0) + game.place[k]=0; if (obj == CAGE && game.prop[BIRD] == 1)DROP(BIRD,game.loc); DROP(obj,game.loc); if (obj != BIRD) return(2012);