[Change] ai.exists() is more lenient with bad parameters. ;)

This commit is contained in:
Allanis 2013-08-10 18:04:39 +01:00
parent 51db82aa25
commit b9c1f021b2

View File

@ -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? */