]> granicus.if.org Git - nethack/commit
GOLDOBJ compat (main trunk only)
authornethack.allison <nethack.allison>
Fri, 11 Apr 2003 22:32:08 +0000 (22:32 +0000)
committernethack.allison <nethack.allison>
Fri, 11 Apr 2003 22:32:08 +0000 (22:32 +0000)
commite1aa6d5148e953e33c0609ab5a86e1a45385271e
tree4232c6aff3b8377337841fb8987c99dcdd851ebb
parentb39599719eb5e5f1a2e9b35f2162d30d17988bc8
GOLDOBJ compat (main trunk only)

This patch gives game and savefile compatibility
whether GOLDOBJ is defined or not.

You can build with GOLDOBJ defined or not, and
still load your saved games. Rebuild with the
opposite, and load the same game.

That way GOLDOBJ can be experimented with
more easily.

1. Leave the "you" struct and the "monst"
   struct the same under the hood between
   GOLDOBJ and !GOLDOBJ.

2. Always write out gold as an
   object on the player and monster
   inventory chains.

On a restore of the savefile with GOLDOBJ
not defined,  take the gold objects out of
the inventory chains and put it into u.ugold
or mtmp->mgold as appropriate.

On a restore of the savefile with GOLDOBJ
defined, nothing special is done.
include/extern.h
include/monst.h
include/patchlevel.h
include/you.h
src/restore.c
src/save.c
util/makedefs.c