From af0979903c8953718fa4045619d6a5beb416d9cf Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 1 Jan 2022 17:09:21 -0500 Subject: [PATCH] Core/Spline: Fix crash Port From (https://github.com/TrinityCore/TrinityCore/commit/e998a1169d9570ae1fe44683287eaf443b573089) --- Source/Game/Movement/Spline.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Game/Movement/Spline.cs b/Source/Game/Movement/Spline.cs index 5254e0a36..699906cc7 100644 --- a/Source/Game/Movement/Spline.cs +++ b/Source/Game/Movement/Spline.cs @@ -318,7 +318,13 @@ namespace Game.Movement + vertice[2] * weights.Z + vertice[3] * weights.W; } - public int Length() { return lengths[index_hi];} + public int Length() + { + if (lengths.Length == 0) + return 0; + + return lengths[index_hi]; + } public int Length(int first, int last) { return lengths[last] - lengths[first]; }