You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When saving world in hamsandwich format, all changes made in base items don't save.
Expected behavior
Hamsandwich format should save changed base items as well as it does with new items.
Actual behavior
Only new items are saved, but all changes made in base items are withdrawn.
However, world files saved in legacy supreme format stage those changes.
Steps to reproduce
Create new world;
Change base item;
Save world in Hamsandwich format;
Load saved world.
There is item_definitions section in new format, and it doesn't contain changed items data.
test_world.dlw
test_world.dlw_old
Possible reasons
The problem is probably in world2.cpp:
for (int i = NUM_ORIGINAL_ITEMS; i < NumItems(); ++i)
{
item_definitions.write_string(""); // savename not yet implementedSaveItem(&item_definitions, GetItem(i));
}
We're only iterating through items which ids are between NUM_ORIGINAL_ITEMS and NumItems(), which are new added items.
Legacy saving method is using SaveItems function which handles cases when items were changed by player.
changedItems=numItems-NUM_ORIGINAL_ITEMS;
for(i=0;i<NUM_ORIGINAL_ITEMS;i++)
{
// has this item been modified in some way?if(memcmp(&items[i],&baseItems[i],sizeof(item_t)))
changedItems++;
}
Description
When saving world in hamsandwich format, all changes made in base items don't save.
Expected behavior
Hamsandwich format should save changed base items as well as it does with new items.
Actual behavior
Only new items are saved, but all changes made in base items are withdrawn.
However, world files saved in legacy
supreme
format stage those changes.Steps to reproduce
There is
item_definitions
section in new format, and it doesn't contain changed items data.test_world.dlw
test_world.dlw_old
Possible reasons
The problem is probably in
world2.cpp
:ref:
https://github.com/SpaceManiac/HamSandwich/blob/84f4b945165f134a7686f595be57fd096c2891ac/source/supreme/world2.cpp#L370C1-L374C3
We're only iterating through items which ids are between
NUM_ORIGINAL_ITEMS
andNumItems()
, which are new added items.Legacy saving method is using
SaveItems
function which handles cases when items were changed by player.ref:
https://github.com/SpaceManiac/HamSandwich/blob/84f4b945165f134a7686f595be57fd096c2891ac/source/supreme/items.cpp#L1075C1-L1081C3
The text was updated successfully, but these errors were encountered: