Skip to content

Commit

Permalink
make light objects unseen when saving level change data, because leve…
Browse files Browse the repository at this point in the history
…l change data (instead of real save data) does not save light source and if the light objects will be marked as seen there lights won't be created and they stay dark
  • Loading branch information
ThomasChr committed Nov 12, 2021
1 parent f090da3 commit 47cf9fb
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Source/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2086,8 +2086,23 @@ void SaveLevel()
file.WriteLE<int8_t>(objectId);
for (int objectId : AvailableObjects)
file.WriteLE<int8_t>(objectId);
for (int i = 0; i < ActiveObjectCount; i++)
for (int i = 0; i < ActiveObjectCount; i++) {
/* make dynamic light sources unseen when saving level data for level change */
switch (Objects[ActiveObjects[i]]._otype) {
case OBJ_L1LIGHT:
case OBJ_SKFIRE:
case OBJ_CANDLE1:
case OBJ_CANDLE2:
case OBJ_BOOKCANDLE:
case OBJ_STORYCANDLE:
case OBJ_TORCHL:
case OBJ_TORCHR:
case OBJ_TORCHL2:
case OBJ_TORCHR2:
Objects[ActiveObjects[i]]._oVar1 = 0;
}
SaveObject(file, Objects[ActiveObjects[i]]);
}
}

for (int itemId : ActiveItems)
Expand Down

0 comments on commit 47cf9fb

Please sign in to comment.