diff --git a/TODO b/TODO index ba0a120..be94180 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,10 @@ Vital: -- Pilot Communication system. + -- Request fuel. -- Introductory screen (text + image?). -- System obstacles and such. -- Interference -- Asteroids. - -- More loading screens. -- Real news. -- Dynamic Economy. diff --git a/bin/Makefile b/bin/Makefile index 79d8123..2678524 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -74,6 +74,7 @@ DATA_AI := $(wildcard ../scripts/ai/*.lua \ ../scripts/ai/include/*.lua \ ../scripts/ai/tpl/*.lua) DATA_GFX := $(wildcard ../gfx/*.png \ + ../gfx/loading/*.png \ ../gfx/gui/*.png \ ../gfx/logo/*.png \ ../gfx/outfit/space/*.png \ diff --git a/gfx/loading/admonisher.png b/gfx/loading/admonisher.png new file mode 100644 index 0000000..4a6c702 Binary files /dev/null and b/gfx/loading/admonisher.png differ diff --git a/gfx/loading/gawain.png b/gfx/loading/gawain.png new file mode 100644 index 0000000..7d6706b Binary files /dev/null and b/gfx/loading/gawain.png differ diff --git a/gfx/loading/goddard.png b/gfx/loading/goddard.png new file mode 100644 index 0000000..6554cf5 Binary files /dev/null and b/gfx/loading/goddard.png differ diff --git a/gfx/loading/llama.png b/gfx/loading/llama.png new file mode 100644 index 0000000..f67677f Binary files /dev/null and b/gfx/loading/llama.png differ diff --git a/gfx/loading/mule.png b/gfx/loading/mule.png new file mode 100644 index 0000000..d35b1aa Binary files /dev/null and b/gfx/loading/mule.png differ diff --git a/gfx/loading000.png b/gfx/loading/pacifier.png similarity index 100% rename from gfx/loading000.png rename to gfx/loading/pacifier.png diff --git a/src/comm.c b/src/comm.c index 76319ad..efcf89f 100644 --- a/src/comm.c +++ b/src/comm.c @@ -121,6 +121,7 @@ static void comm_bribe(unsigned int wid, char* unused) { int answer; int price; char* str; + lua_State* L; /* Set up for the comm_get* functions. */ ai_setPilot(comm_pilot); @@ -162,7 +163,15 @@ static void comm_bribe(unsigned int wid, char* unused) { dialogue_msg("Bribe Pilot", "\"Pleasure to do business with you.\""); else dialogue_msg("Bribe Pilot", "%s", str); + + /* Mark as bribed and don't allow bribing again. */ pilot_setFlag(comm_pilot, PILOT_BRIBED); + L = comm_pilot->ai->L; + lua_getglobal(L, "mem"); + lua_pushnil(L); + lua_setfield(L, -2, "bribe"); + lua_pop(L, 1); + /* Reopen window. */ window_destroy(wid); comm_open(comm_pilot->id); diff --git a/src/lephisto.c b/src/lephisto.c index d02cf03..d8fac06 100644 --- a/src/lephisto.c +++ b/src/lephisto.c @@ -279,6 +279,7 @@ int main(int argc, char** argv) { void loadscreen_load(void) { int i; char file_path[PATH_MAX]; + char** loadscreens; char** files; uint32_t nfiles; size_t len; @@ -286,12 +287,15 @@ void loadscreen_load(void) { /* Count the loading screens. */ files = pack_listfiles(data, &nfiles); - len = strlen("../gfx/loading"); + len = strlen("../gfx/loading/"); nload = 0; + loadscreens = malloc(sizeof(char*) * nfiles); for(i = 0; i < (int)nfiles; i++) { - if(strncmp(files[i], "../gfx/loading", len)==0) + if(strncmp(files[i], "../gfx/loading/", len)==0) { + loadscreens[nload] = files[i]; nload++; - free(files[i]); + } else + free(files[i]); } /* Must have loading screens. */ @@ -301,8 +305,13 @@ void loadscreen_load(void) { } /* Load the texture. */ - snprintf(file_path, PATH_MAX, "../gfx/loading%03d.png", RNG(0, nload-1)); + snprintf(file_path, PATH_MAX, loadscreens[RNG(0, nload-1)]); loading = gl_newImage(file_path); + + /* Clean up. */ + for(i = 0; i < nload; i++) + free(loadscreens[i]); + free(loadscreens); } /** diff --git a/src/save.c b/src/save.c index 58649ad..95e5a2c 100644 --- a/src/save.c +++ b/src/save.c @@ -1,7 +1,4 @@ -#ifdef _POSIX_SOURCE -#include <unistd.h> /* Unlink. */ -#endif - +#include <stdio.h> /* remove() */ #include "lephisto.h" #include "log.h" #include "xml.h" @@ -191,7 +188,7 @@ static void load_menu_delete(unsigned int wdw, char* str) { return; snprintf(path, PATH_MAX, "%ssaves/%s.ls", lfile_basePath(), save); - unlink(path); + remove(path); /* Remove is more portable and will call unlink on Linux. */ /* Need to reload the menu. */ load_menu_close(wdw, NULL);