mirror of
https://github.com/kwsch/pkNX.git
synced 2026-09-09 11:05:35 -05:00
Default to 0 if relative offset is 0
fixes bad move type values
This commit is contained in:
@@ -160,6 +160,8 @@ byte ReadU8(int v, int o)
|
||||
if (vptr > vLength)
|
||||
return default;
|
||||
var rofs = BitConverter.ToUInt16(data, vptr);
|
||||
if (rofs == 0)
|
||||
return default;
|
||||
return data[root + rofs];
|
||||
}
|
||||
|
||||
@@ -169,6 +171,8 @@ ushort ReadU16(int v, int o)
|
||||
if (vptr > vLength)
|
||||
return default;
|
||||
var rofs = BitConverter.ToUInt16(data, vptr);
|
||||
if (rofs == 0)
|
||||
return default;
|
||||
return BitConverter.ToUInt16(data, root + rofs);
|
||||
}
|
||||
|
||||
@@ -178,6 +182,8 @@ bool ReadB8(int v, int o)
|
||||
if (vptr > vLength)
|
||||
return default;
|
||||
var rofs = BitConverter.ToUInt16(data, vptr);
|
||||
if (rofs == 0)
|
||||
return default;
|
||||
return data[root + rofs] == 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user