Items didn't spawn at for Terrace #78

Closed
opened 2018-02-15 08:04:16 +00:00 by daerogami · 2 comments
daerogami commented 2018-02-15 08:04:16 +00:00 (Migrated from github.com)

for example: only the armour in the store room spawned, none of the weapons of shields or lockpicks


I didn't have this issue in the latest build, lets have someone else confirm then close if all is good.
This is an item logged from the To-Do and was originally reported by GiantFriendlyTalkingSpiderman. If you are familiar with or can recreate this bug, please provide details here.

for example: only the armour in the store room spawned, none of the weapons of shields or lockpicks --- I didn't have this issue in the latest build, lets have someone else confirm then close if all is good. This is an item logged from the To-Do and was originally reported by GiantFriendlyTalkingSpiderman. If you are familiar with or can recreate this bug, please provide details here.
CelticMinstrel commented 2018-02-16 03:57:30 +00:00 (Migrated from github.com)

I think this might be the same as #106, or at least related.

I think this might be the same as #106, or at least related.
NQNStudios commented 2025-05-04 13:50:16 +00:00 (Migrated from github.com)

I believe I know why this happened and have the fix.

b305f03cc7/src/scenario/scenario.cpp (L546)

Here, we're saving out the item_taken bitset for each town but skipping ones where no item was taken, so we're writing something like

0 <bitset>
2 <bitset>
6 <bitset>

b305f03cc7/src/scenario/scenario.cpp (L559)

Here we're reading those bitsets in, but not treating it as map-encoded. So the wrong bitsets can load into the wrong towns. This also causes an item duplication bug. Using extractSparse() and making sure the bitsets get assigned properly should fix my item dupe bug and bugs like this where items never spawn where they should.

I believe I know why this happened and have the fix. https://github.com/calref/cboe/blob/b305f03cc7829e781e7f456a417e488d4f61cb54/src/scenario/scenario.cpp#L546 Here, we're saving out the item_taken bitset for each town but skipping ones where no item was taken, so we're writing something like ``` 0 <bitset> 2 <bitset> 6 <bitset> ``` https://github.com/calref/cboe/blob/b305f03cc7829e781e7f456a417e488d4f61cb54/src/scenario/scenario.cpp#L559 Here we're reading those bitsets in, but not treating it as map-encoded. So the wrong bitsets can load into the wrong towns. This also causes an item duplication bug. Using `extractSparse()` and making sure the bitsets get assigned properly should fix my item dupe bug *and* bugs like this where items never spawn where they should.
Sign in to join this conversation.
No description provided.