On 9 March 2013 03:09, Ralph Versteegen <[email protected]> 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).

Oh, of course resetgame is only called to reset after having already
played the game.

I consider resetgame/initgamedefaults/all the other initialisation
randomly scattered about a big maintenance burden. We ought to do the
same state initialisation regardless of whether we're resetting, and
all in one place.

> You forgot to mention the fix in whatsnew.
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to