On Sat, Mar 09, 2013 at 05:29:20PM +1300, Ralph Versteegen wrote: > On 9 March 2013 17:14, James Paige <[email protected]> wrote: > > On Sat, Mar 09, 2013 at 04:37:10PM +1300, Ralph Versteegen wrote: > >> On 9 March 2013 07:06, James Paige <[email protected]> wrote: > >> > On Sat, Mar 09, 2013 at 03:09:54AM +1300, Ralph Versteegen wrote: > >> >> On 8 March 2013 09:46, <[email protected]> wrote: > >> >> > james > >> >> > 2013-03-07 12:46:26 -0800 (Thu, 07 Mar 2013) > >> >> > 363 > >> >> > Fix broken shop stock limits. > >> >> > resetgame was defaulting stock to -1 "infinite" instead of 0 > >> >> > "unloaded" > >> >> > Also changed the default for a missing stock node in the RSAV file > >> >> > (Warning: this means that for any existing savegames, > >> >> > a shop that has aquired an item when you sold it a copy because > >> >> > it had "Selltype: Acquire" will have that item's stock reset to > >> >> > defaults) > >> >> > --- > >> >> > U wip/moresubs.bas > >> >> > U wip/savegame.rbas > >> >> > >> >> Ah ha. So this has been broken since Zenzizenzic then. > >> >> > >> >> This is the first time I've ever looked into how shop stock works. I > >> >> never knew about the load-on-first-use scheme. So it allows adding new > >> >> items to shops without breaking saves. Maybe I can do even better than > >> >> that for live-previewing. > >> >> > >> >> But I don't seem to totally understand this bug. Since all of stock() > >> >> defaulted to -1/infinite, doesn't that mean that stock amount was > >> >> never loaded from .STF, and all items in all shops should have > >> >> infinite stock? But stock did sometimes work (for example the shop in > >> >> testgame.rpg). > >> > > >> > As far as I could tell, the situation where shop stock limits worked > >> > correctly was only when you loaded from a save-game created before the > >> > bug existed. Were you testing testgame.rpg with a loaded save? > >> > >> No, since shop stocks were only broken when resetgame was called, the > >> stocks were correct in new games. > > > > Not in my own testing. Before fixing the bug, I could start a new game > > in Wandering Hamster, go to the cheat shop, and my debug statements > > indicated that all the items had stock of -1, even though several of > > them should have been limited. > > In my own testing using testgame.rpg, it's definitely the case that > stocks are correct when starting a New Game, and incorrect when > quitting that and then starting a new new game.
Oh! Thtat makes perfect sense. I bet that was what I was doing! > > ...but that is strange... I had assumed that resetgame was being called > > for new games, but I can see that clearly is not the case. Maybe my test > > was flawed in some way that I don't remember? I am all confused now :P > > Hmm, no idea. > > > What I am pretty confident about is that it is now doing the right > > thing. But I guess my understanding of the wrong thing it was doing > > before is incomplete :) > > > > --- > > James > > Yes, we can all agree that it is definitely correct now (though the > breakage of Acquire Infinite Inventory in existing saves is > regrettable... maybe we could include a workaround and bump the RSAV > version. But to be honest using that Sell Type never made sense to > me!) I think is is probably pretty rarely used. --- James _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
