mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
Fix deserialization of int64 values
This commit is contained in:
@ -131,12 +131,12 @@ public:
|
|||||||
|
|
||||||
if ((byteValue & 0x80) != 0)
|
if ((byteValue & 0x80) != 0)
|
||||||
{
|
{
|
||||||
valueUnsigned |= (byteValue & 0x7f) << offset;
|
valueUnsigned |= static_cast<uint64_t>(byteValue & 0x7f) << offset;
|
||||||
offset += 7;
|
offset += 7;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
valueUnsigned |= (byteValue & 0x3f) << offset;
|
valueUnsigned |= static_cast<uint64_t>(byteValue & 0x3f) << offset;
|
||||||
bool isNegative = (byteValue & 0x40) != 0;
|
bool isNegative = (byteValue & 0x40) != 0;
|
||||||
if (isNegative)
|
if (isNegative)
|
||||||
return -static_cast<int64_t>(valueUnsigned);
|
return -static_cast<int64_t>(valueUnsigned);
|
||||||
|
Reference in New Issue
Block a user