diff options
Diffstat (limited to 'src/saveload/saveload.cpp')
-rw-r--r-- | src/saveload/saveload.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 29adb40c9..348ba93ba 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -1710,17 +1710,15 @@ bool SlObjectMember(void *ptr, const SaveLoad *sld) } break; - /* SL_WRITEBYTE translates a value of a variable to another one upon - * saving or loading. - * XXX - variable renaming abuse - * game_value: the value of the variable ingame is abused by sld->version_from - * file_value: the value of the variable in the savegame is abused by sld->version_to */ + /* SL_WRITEBYTE writes a value to the savegame to identify the type of an object. + * When loading, the value is read explictly with SlReadByte() to determine which + * object description to use. */ case SL_WRITEBYTE: switch (_sl.action) { - case SLA_SAVE: SlWriteByte(sld->version_to); break; + case SLA_SAVE: SlWriteByte(*(uint8 *)ptr); break; case SLA_LOAD_CHECK: - case SLA_LOAD: *(byte *)ptr = sld->version_from; break; - case SLA_PTRS: break; + case SLA_LOAD: + case SLA_PTRS: case SLA_NULL: break; default: NOT_REACHED(); } |