[Fix] Last commit was crappy.
This commit is contained in:
parent
91f29c9511
commit
28c5b6ea73
12
src/ai.c
12
src/ai.c
@ -73,8 +73,8 @@ static int ai_minbrakedist(lua_State* L); // Number minbrakedist()
|
||||
// Boolean expressions.
|
||||
static int ai_ismaxvel(lua_State* L); // Boolean ismaxvel()
|
||||
static int ai_isstopped(lua_State* L); // Boolean isstopped()
|
||||
static int ai_isenemy(lua_State* L); // bool isenemy(pointer).
|
||||
static int ai_isally(lua_State* L); // bool isally(pointer).
|
||||
static int ai_isenemy(lua_State* L); // bool isenemy(number).
|
||||
static int ai_isally(lua_State* L); // bool isally(number).
|
||||
// Movement.
|
||||
static int ai_accel(lua_State* L); // accel(number); nuimber <= 1.
|
||||
static int ai_turn(lua_State* L); // turn(number); abs(number) <= 1.
|
||||
@ -219,7 +219,7 @@ static int ai_pushtask(lua_State* L) {
|
||||
t->ID = (unsigned int) lua_tonumber(L, 3);
|
||||
}
|
||||
else if(lua_islightuserdata(L, 3)) {
|
||||
t-dtype = TYPE_PTR;
|
||||
t->dtype = TYPE_PTR;
|
||||
t->target = (void*)lua_topointer(L, 3);
|
||||
} else
|
||||
t->dtype = TYPE_NULL;
|
||||
@ -329,11 +329,14 @@ static int ai_isstopped(lua_State* L) {
|
||||
|
||||
// Check if the pilot is an enemy.
|
||||
static int ai_isenemy(lua_State* L) {
|
||||
if(lua_isnumber(L,1))
|
||||
lua_pushboolean(L, areEnemies(cur_pilot->faction, pilot_get(lua_tonumber(L,1))->faction));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Check if the pilot is an ally.
|
||||
static int ai_isally(lua_State* L) {
|
||||
lua_pushboolean(L, areAllies(cur_pilot->faction, pilot_get(lua_tonumber(L,1))->faction));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -397,7 +400,8 @@ static int ai_shoot(lua_State* L) {
|
||||
|
||||
// Get the nearest enemy.
|
||||
static int ai_getenemy(lua_State* L) {
|
||||
return 0;
|
||||
lua_pushnumber(L,1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Create a vector.
|
||||
|
Loading…
Reference in New Issue
Block a user