From b9c1f021b25d8da46bace9e0a6ce03e97ef169c5 Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 10 Aug 2013 18:04:39 +0100 Subject: [PATCH] [Change] ai.exists() is more lenient with bad parameters. ;) --- src/ai.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ai.c b/src/ai.c index 68094d3..885a16c 100644 --- a/src/ai.c +++ b/src/ai.c @@ -619,7 +619,6 @@ static int ai_cargofree(lua_State* L) { static int ai_exists(lua_State* L) { Pilot* p; int i; - LLUA_MIN_ARGS(1); if(lua_isnumber(L,1)) { i = 1; @@ -629,7 +628,10 @@ static int ai_exists(lua_State* L) { lua_pushboolean(L, i); return 1; } - LLUA_INVALID_PARAMETER(); + + /* Default to false for everything that isn't a pilot. */ + lua_pushboolean(L, 0); + return 0; } /* Are we at max velocity? */