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