[comp.sources.games.bugs] omega inventory bugs

cthombor@umn-d-ub.D.UMN.EDU (Clark Thomborson) (09/26/88)

Here's yet another Omega inventory bug fix.  Use this one to avoid the
ermanent loss of armor points and other stats.

The problem is that the "used" flag on an object doesn't get reset when
you take it out of use by putting it directly into your pack.  Such used/unused
objects are very hazardous: you can take your stats down to any desired(?)
negative level by repeatedly "t" taking them into the up-in-the-air slot
then "p" putting them back into the pack.

A record copy in split_item makes this bug a little hard to find.

The fix is simple: just reset the used flag in the put_to_pack subroutine
of oinv.c.  I've enclosed a diff to be run AFTER you've installed
cjs's oinv.c fixes (see article 488 of comp.sources.games.bugs).

After updating your code, I recommend you clear the "used" flags on every
previously-used but accessible object (in your pack, in the city...) by
putting it in use momentarily, then "d" dropping it or "p" putting it back
in your pack.

Happy hunting!

===========================================================================
diff -c cjs/oinv.c new/oinv.c
*** cjs/oinv.c	Tue Sep 20 13:25:21 1988
--- new/oinv.c	Wed Sep 21 10:26:33 1988
***************
*** 939,944 ****
--- 939,945 ----
        waitflag = (oslot->used && (oslot->number == num));
        conform_lost_objects(num,oslot);
        if (waitflag) morewait();
+       temp->used = FALSE;
        add_to_pack(temp);
      }
    }
===========================================================================