From 05fe285d87e706cc64e4db8e79f02a12ee5a7b41 Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 30 Jun 2013 17:17:09 +0100 Subject: [PATCH] [Change] Now load the basic lua stuff. --- src/ai.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ai.c b/src/ai.c index ecdfa00..ee772f2 100644 --- a/src/ai.c +++ b/src/ai.c @@ -271,8 +271,8 @@ static int ai_loadProfile(char* filename) { L = profiles[nprofiles-1].L; - /* Open the standard Lua libraries. */ - /*luaL_openlibs(L); */ + /* Open basic Lua stuff. */ + llua_loadBasic(L); /* Constants. */ 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; lua_getglobal(L, "attacked"); 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. */