From 40aa774ff77d36d0f8d395ccbd43f67063ce5716 Mon Sep 17 00:00:00 2001 From: Allanis Date: Mon, 10 Mar 2014 16:48:42 +0000 Subject: [PATCH] [Fix] Properly fixed the valgrind issues without causing more. --- src/ai.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ai.c b/src/ai.c index b157de3..a4ca665 100644 --- a/src/ai.c +++ b/src/ai.c @@ -1016,6 +1016,7 @@ static int ai_face(lua_State* L) { /* Get first parameter, aka what to face. */ n = -2; + lv = NULL; if(lua_isnumber(L, 1)) { n = (int)lua_tonumber(L, 1); @@ -1023,9 +1024,7 @@ static int ai_face(lua_State* L) { p = pilot_get(n); if(p == NULL) return 0; /* Make sure pilot is valid. */ vect_cset(&tv, VX(p->solid->pos), VY(p->solid->pos)); - lv = NULL; } - else LLUA_INVALID_PARAMETER(); } else if(lua_isvector(L, 1)) lv = lua_tovector(L, 1);