add error check

This commit is contained in:
in0finite 2021-09-11 01:03:40 +02:00
parent 1c389b2d91
commit 88580229d0

View file

@ -251,6 +251,8 @@ namespace SanAndreasUnity.Importing.Paths
NumOfNodes = (int)reader.ReadUInt32();
NumOfVehNodes = (int)reader.ReadUInt32();
NumOfPedNodes = (int)reader.ReadUInt32();
if (NumOfVehNodes + NumOfPedNodes != NumOfNodes)
throw new Exception($"Node file {Id} has invalid number of nodes");
NumOfNavNodes = (int)reader.ReadUInt32();
NumOfLinks = (int)reader.ReadUInt32();
}