[Change] Mkay, escorts should properly hang if they have no target to

escort.
This commit is contained in:
Allanis 2014-05-21 00:23:41 +01:00
parent ace738021f
commit 8c3836ce50
2 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,7 @@ function escort()
target = mem.escort
-- Will just float without a target to escort.
if target == nil then
if not ai.exists(target) then
return
end

View File

@ -266,9 +266,13 @@ static void ai_setMemory(void) {
L = cur_pilot->ai->L;
lua_getglobal(L, "pilotmem");
/* pilotmem */
lua_pushnumber(L, cur_pilot->id);
/* pilotmem, id */
lua_gettable(L, -2);
/* pilotmem, table */
lua_setglobal(L, "mem");
/* pilotmem */
lua_pop(L, 1);
}