mbkarle / mind-the-fog

Roguelike JavaScript game--mind the fog!
2 stars 1 forks source link

Floor with multiple rooms, spawn in room w no doors #86

Closed akarle closed 6 years ago

akarle commented 7 years ago

Other facts:

It was likely an issue with one of these 2

mbkarle commented 7 years ago

I have just now encountered this bug, and my investigations may bring some clarity to the issue:

Alchemist errors were indeed on the first purchase of an item (when it is "prototyped" and populated throughout the dungeon"). I have fixed that on my current branch and it is unrelated to this issue (issue was merchants picking their items determine a value based on the itemList that the Item is found in [1, 2, 3 or 4]. This is referenced in the .items property of an Item, which consumables don't have, so it was throwing undefined.).

The current issue, while I still don't know what exactly causes it, is directly inherent to the refillChests function, which is called every time a consumable is purchased for the first time, so that the chests will contain it on the run that it was purchased on. Even calling refillChests in console without interacting with the alchemist was enough to cause the no doors bug.

The refillChests function just rebuilds all of the floors except the great hall. For whatever reason (and I'm pretty sure it didn't always do this) it is no longer including the doors when it does so.

The question is, is this worth fixing at the moment? With the floors 2.0 update coming (eventually), the current door building system will be totally remodeled and it will all probably be a moot point.

mbkarle commented 7 years ago

I looked into it anyways and believe I have fixed it on my branch. Some bizarre if-else condition that was responsible for placing next room doors seems to be the culprit; to be honest I have no idea why it even worked to begin with on initial floor build.

akarle commented 6 years ago

We believe fixed for now... new #103 will alter this anyways. Closing for now.