diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -793,7 +793,7 @@ void WriteValue(void *ptr, VarType conv, case SLE_VAR_U32: *(uint32*)ptr = val; break; case SLE_VAR_I64: *(int64 *)ptr = val; break; case SLE_VAR_U64: *(uint64*)ptr = val; break; - case SLE_VAR_NAME: *(char**)ptr = CopyFromOldName(val); break; + case SLE_VAR_NAME: *reinterpret_cast(ptr) = CopyFromOldName(val); break; case SLE_VAR_NULL: break; default: NOT_REACHED(); } @@ -1515,6 +1515,8 @@ static bool IsVariableSizeRight(const Sa case SLE_VAR_I64: case SLE_VAR_U64: return sld->size == sizeof(int64); + case SLE_VAR_NAME: + return sld->size == sizeof(std::string); default: return sld->size == sizeof(void *); }