mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-01-10 07:42:56 +08:00
Fix for BoundVertex going out of range on XML import
This commit is contained in:
parent
05bd42f3a6
commit
4b65af9d74
@ -4465,15 +4465,20 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
public BoundVertex_s(Vector3 v)
|
public BoundVertex_s(Vector3 v)
|
||||||
{
|
{
|
||||||
X = (short)v.X;
|
X = (short)Math.Min(Math.Max(v.X, -32767f), 32767f);
|
||||||
Y = (short)v.Y;
|
Y = (short)Math.Min(Math.Max(v.Y, -32767f), 32767f);
|
||||||
Z = (short)v.Z;
|
Z = (short)Math.Min(Math.Max(v.Z, -32767f), 32767f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 Vector
|
public Vector3 Vector
|
||||||
{
|
{
|
||||||
get { return new Vector3(X, Y, Z); }
|
get { return new Vector3(X, Y, Z); }
|
||||||
set { X = (short)value.X; Y = (short)value.Y; Z = (short)value.Z; }
|
set
|
||||||
|
{
|
||||||
|
X = (short)Math.Min(Math.Max(value.X, -32767f), 32767f);
|
||||||
|
Y = (short)Math.Min(Math.Max(value.Y, -32767f), 32767f);
|
||||||
|
Z = (short)Math.Min(Math.Max(value.Z, -32767f), 32767f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user