Skip to content

Commit ad43ff2

Browse files
committed
Fixes
1 parent 4be9e49 commit ad43ff2

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎Game.Client/GarrysMod/LuaSurface.cs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,13 @@ static int DrawPoly(ILuaInterface lua) {
388388
vertex.UnReference();
389389
}
390390

391-
if (count < 3)
391+
if (count < 3) {
392+
vertices.UnReference();
392393
lua.ArgError(1, "table must contain at least three vertices");
393-
else
394-
surface.DrawTexturedPolygon(((Span<SurfaceVertex>)PolyVerts)[..count], true);
394+
return 0;
395+
}
396+
397+
surface.DrawTexturedPolygon(((Span<SurfaceVertex>)PolyVerts)[..count], true);
395398
vertices.UnReference();
396399
return 0;
397400
}

‎Game.Shared/GarrysMod/LuaVMatrix.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ static int VMatrix__InvertTR(ILuaInterface lua) {
221221
[LuaMethod]
222222
static int VMatrix__InvertTR2(ILuaInterface lua) {
223223
ref Matrix4x4 m = ref Get_VMatrix(1);
224-
MathLib.MatrixInverseTR(in m, out m);
224+
Matrix4x4 src = m;
225+
MathLib.MatrixInverseTR(in src, out m);
225226
return 0;
226227
}
227228

0 commit comments

Comments
 (0)