[Change] Only have ai land once.
This commit is contained in:
parent
fadd885c80
commit
deeea15889
@ -9,6 +9,12 @@
|
||||
-- Attempt to land on a planet.
|
||||
--]]
|
||||
function land()
|
||||
-- Only want to land once, prevents guys fomr never leaving.
|
||||
if mem.landed then
|
||||
ai.poptask()
|
||||
return
|
||||
end
|
||||
|
||||
target = mem.land
|
||||
dir = ai.face(target)
|
||||
dist = ai.dist(target)
|
||||
@ -45,6 +51,7 @@ function landwait()
|
||||
ai.pushtask(0, "land")
|
||||
|
||||
elseif ai.timeup(0) then
|
||||
mem.landed = true -- Mark as landed so they don't spend time forever floating around.
|
||||
ai.poptask() -- Ready to do whatever we were doing before.
|
||||
end
|
||||
end
|
||||
@ -55,6 +62,7 @@ end
|
||||
function runaway()
|
||||
target = ai.target()
|
||||
|
||||
-- Target must exist.
|
||||
if not ai.exists(target) then
|
||||
ai.poptask()
|
||||
return
|
||||
|
@ -1273,8 +1273,10 @@ void land_cleanup(void) {
|
||||
land_visited = 0;
|
||||
|
||||
/* Destroy window. */
|
||||
if(land_wid > 0)
|
||||
if(land_wid > 0) {
|
||||
window_destroy(land_wid);
|
||||
land_wid = 0;
|
||||
}
|
||||
|
||||
/* Clean up possible stray graphic. */
|
||||
if(gfx_exterior != NULL) {
|
||||
|
@ -35,10 +35,10 @@ char* lfile_basePath(void) {
|
||||
if(lephisto_base[0] == '\0') {
|
||||
#ifdef LINUX
|
||||
home = getenv("HOME");
|
||||
snprintf(lephisto_base, PATH_MAX, "%s/.lephisto/", home);
|
||||
#else
|
||||
#error "Needs implentation."
|
||||
#endif
|
||||
snprintf(lephisto_base, PATH_MAX, "%s/.lephisto/", home);
|
||||
}
|
||||
|
||||
return lephisto_base;
|
||||
|
Loading…
Reference in New Issue
Block a user