FiendsOfTheElements / FF1Randomizer

A randomizer for Final Fantasy 1 on the NES.
http://finalfantasyrandomizer.com
GNU General Public License v3.0
82 stars 46 forks source link

Placement Logic fails when Shop Shuffle is disabled #1073

Closed pboyer84 closed 5 months ago

pboyer84 commented 5 months ago

URL to reproduce: https://beta-09fe785c.finalfantasyrandomizer.com/?s=89BCA881&f=ai.B90wZWJH80Ll1zfenpQQ6CiPemginvpwx67gcXQheOqVItk6ootRUGp6X-fnf90AkbkGLWA3onXwR3pVbu5GLIZgkGKR0kxxDux8wQ3pK..20Dpq0kCZ0aUzOOY4U8d04qhDyQaGNVmKRKeQt.QauI.3w4lvKxS34c5aZ8i

Additional details: Shop Shuffle Disabled

Placement Logic Fails

pboyer84 commented 5 months ago

I fixed it in my local copy by setting ItemShopSlot to its vanilla value in the ShuffleShops methods of ShopData.

A more robust fix might be to initialize ItemShopSlot to vanilla in the ShopData constructor or an inline initial value for the property? This way it is guaranteed non-null before it has a chance to be accessed by any logic.

image

pboyer84 commented 5 months ago

There is a PR for this issue under review.

https://github.com/FiendsOfTheElements/FF1Randomizer/pull/1074

wildham0 commented 5 months ago

Fix merged