Fix a small bug in parsing shader names from Source engine.

This commit is contained in:
Will
2015-10-11 21:21:41 -06:00
parent c8ad5a842a
commit b7811825ef

View File

@@ -66,9 +66,10 @@ namespace LibBSP {
for (int i = 0; i < data.Length; ++i) {
if (data[i] == (byte)0x00) {
// They are null-terminated strings, of non-constant length (not padded)
bytes = new byte[i - offset - 1];
Array.Copy(data, offset, bytes, 0, i - offset - 1);
bytes = new byte[i - offset];
Array.Copy(data, offset, bytes, 0, i - offset);
Add(new Texture(bytes, type));
offset = i + 1;
}
}
return;