[Change] ai.exists() is more lenient with bad parameters. ;)
This commit is contained in:
parent
51db82aa25
commit
b9c1f021b2
6
src/ai.c
6
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? */
|
||||
|
Loading…
Reference in New Issue
Block a user