[Change] Now load the basic lua stuff.
This commit is contained in:
parent
cad5bd932c
commit
05fe285d87
7
src/ai.c
7
src/ai.c
@ -271,8 +271,8 @@ static int ai_loadProfile(char* filename) {
|
|||||||
|
|
||||||
L = profiles[nprofiles-1].L;
|
L = profiles[nprofiles-1].L;
|
||||||
|
|
||||||
/* Open the standard Lua libraries. */
|
/* Open basic Lua stuff. */
|
||||||
/*luaL_openlibs(L); */
|
llua_loadBasic(L);
|
||||||
|
|
||||||
/* Constants. */
|
/* Constants. */
|
||||||
lua_regnumber(L, "player", PLAYER_ID); /* Player id. */
|
lua_regnumber(L, "player", PLAYER_ID); /* Player id. */
|
||||||
@ -365,7 +365,8 @@ void ai_attacked(Pilot* attacked, const unsigned int attacker) {
|
|||||||
L = cur_pilot->ai->L;
|
L = cur_pilot->ai->L;
|
||||||
lua_getglobal(L, "attacked");
|
lua_getglobal(L, "attacked");
|
||||||
lua_pushnumber(L, attacker);
|
lua_pushnumber(L, attacker);
|
||||||
lua_pcall(L, 1, 0, 0);
|
if(lua_pcall(L, 1, 0, 0))
|
||||||
|
WARN("Pilot '%s' ai -> 'attacked' : %s", cur_pilot->name, lua_tostring(L, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pilot was just created. */
|
/* Pilot was just created. */
|
||||||
|
Loading…
Reference in New Issue
Block a user