diff --git a/dialogues.c b/dialogues.c index 1a4d1ea42..09d1e6ae1 100644 --- a/dialogues.c +++ b/dialogues.c @@ -666,10 +666,36 @@ static int cm_npcname_handler(window_info *win, int widget_id, int mx, int my, i copy_to_clipboard((const char *)npc_name); else if (option == 1) { - char str[80]; - safe_snprintf(str, sizeof(str), npc_mark_str, npc_name); + char *str = NULL, *del_pos = NULL; + const char *delim = "%s"; + size_t delim_len = strlen(delim); + size_t npc_name_len = 0, start_len = 0, end_len = 0, str_len = 0; + + if (npc_mark_str == NULL || npc_name == NULL || !strlen(npc_mark_str) || + !(npc_name_len = strlen((char *)npc_name)) || + ((del_pos = strstr(npc_mark_str, delim)) == NULL)) + { + LOG_TO_CONSOLE(c_red1, invalidnpcmark_str); + return 0; + } + + start_len = del_pos - npc_mark_str; + end_len = strlen(&npc_mark_str[start_len + delim_len]); + str_len = start_len + npc_name_len + end_len + 1; + + if ((str = (char *)malloc(str_len)) == NULL) + return 0; + + // previously used sprintf() but its unsafe to use a user specified target string + safe_strncpy2(str, npc_mark_str, str_len, start_len); + str[start_len] = 0; + safe_strcat(str, (char *)npc_name, str_len); + safe_strcat(str, &npc_mark_str[start_len + delim_len], str_len); + command_unmark_special(str, strlen(str), 0); command_mark(str, strlen(str)); + + free(str); } else return 0; diff --git a/elc_private.h b/elc_private.h index e5a80e259..ba0c90d9c 100644 --- a/elc_private.h +++ b/elc_private.h @@ -9,7 +9,7 @@ #define VER_MAJOR 1 #define VER_MINOR 9 #define VER_RELEASE 5 -#define VER_BUILD 2 +#define VER_BUILD 3 #define COMPANY_NAME "" #define FILE_VERSION "1.9.5" #ifdef OTHER_LIFE diff --git a/gamewin.c b/gamewin.c index 417486b19..e7d0cb8c2 100644 --- a/gamewin.c +++ b/gamewin.c @@ -54,6 +54,7 @@ #include "storage.h" #include "tabs.h" #include "textures.h" +#include "translate.h" #include "trade.h" #include "url.h" #include "weather.h" @@ -105,6 +106,15 @@ void check_to_auto_disable_ranging_lock(void) toggle_ranging_lock(); } +static void toggle_target_close_clicked_creature(void) +{ + toggle_OPT_BOOL_by_name("target_close_clicked_creature"); + if (target_close_clicked_creature) + LOG_TO_CONSOLE(c_green1, close_click_targetting_on_str); + else + LOG_TO_CONSOLE(c_green1, close_click_targetting_off_str); +} + void draw_special_cursors(void) { const float RET_WID = 4.0f; @@ -2028,6 +2038,10 @@ int keypress_root_common (Uint32 key, Uint32 unikey) { view_window(&range_win, -1); } + else if(key == K_TARGET_CLOSE) + { + toggle_target_close_clicked_creature(); + } else if (key == K_SIT) { toggle_sit_stand (); diff --git a/keys.c b/keys.c index d77cd3d4f..4c68c9f7a 100644 --- a/keys.c +++ b/keys.c @@ -116,6 +116,7 @@ Uint32 K_ECDEBUGWIN=ALT|CTRL|'c'; #endif Uint32 K_EMOTES=CTRL|'j'; Uint32 K_RANGINGWIN=CTRL|'t'; +Uint32 K_TARGET_CLOSE=ALT|'t'; // Remaining keys are not assigned to the keyboard but // can be redefined or used by the #keypress command. @@ -221,6 +222,7 @@ static key_store_entry key_store[] = #endif { "#K_EMOTES", &K_EMOTES }, { "#K_RANGINGWIN", &K_RANGINGWIN }, + { "#K_TARGET_CLOSE", &K_TARGET_CLOSE }, { "#K_COUNTERS", &K_COUNTERS }, { "#K_HELPSKILLS", &K_HELPSKILLS } }; diff --git a/keys.h b/keys.h index b99d837b1..37f8a2d98 100644 --- a/keys.h +++ b/keys.h @@ -91,6 +91,7 @@ extern Uint32 K_ECDEBUGWIN; /*!< open Eye Candy debug window */ #endif /* ECDEBUGWIN */ extern Uint32 K_EMOTES; /*!< key used to toggle display of \ref emotes_window */ extern Uint32 K_RANGINGWIN; /*!< key used to toggle display of ranging win */ +extern Uint32 K_TARGET_CLOSE; /*!< toggle target_close_clicked_creature option */ extern Uint32 K_COUNTERS; /*!< key used to toggle display of counters window */ extern Uint32 K_HELPSKILLS; /*!< key used to toggle display of help window skills tab */ /*! @} */ diff --git a/map_editor/2d_objects.c b/map_editor/2d_objects.c index 8281ff2c1..085a14911 100644 --- a/map_editor/2d_objects.c +++ b/map_editor/2d_objects.c @@ -419,7 +419,7 @@ int get_2d_bbox (int id, AABBOX* box) int add_2d_obj(char * file_name, float x_pos, float y_pos, float z_pos, float x_rot, float y_rot, float z_rot) { size_t i; - char fname[128]; + char fname[80]; obj_2d_def *returned_obj_2d_def; obj_2d *our_object; short sector; @@ -440,7 +440,7 @@ int add_2d_obj(char * file_name, float x_pos, float y_pos, float z_pos, float x_ returned_obj_2d_def=load_obj_2d_def_cache(fname); if(!returned_obj_2d_def) { - char str[120]; + char str[200]; sprintf(str,"Error: Can't load 2d object: %s\n",fname); log_error(__FILE__, __LINE__, str); return 0; diff --git a/map_editor/3d_objects.c b/map_editor/3d_objects.c index 2647250c9..f24f38640 100644 --- a/map_editor/3d_objects.c +++ b/map_editor/3d_objects.c @@ -213,7 +213,7 @@ e3d_object * load_e3d_cache(char * file_name) int add_e3d_at_id (int id, char * file_name, float x_pos, float y_pos, float z_pos, float x_rot, float y_rot, float z_rot, char self_lit, char blended, float r, float g, float b) { - char fname[128]; + char fname[80]; e3d_object *returned_e3d; object3d *our_object; @@ -227,7 +227,7 @@ int add_e3d_at_id (int id, char * file_name, float x_pos, float y_pos, float z_p returned_e3d=load_e3d_cache(fname); if(returned_e3d==NULL) { - char str[120]; + char str[200]; sprintf (str, "Error: Something nasty happened while trying to process: %s\n", fname); LOG_ERROR(str); @@ -241,7 +241,7 @@ int add_e3d_at_id (int id, char * file_name, float x_pos, float y_pos, float z_p our_object = calloc (1, sizeof(object3d)); // and fill it in - snprintf (our_object->file_name, 80, "%s", fname); + snprintf (our_object->file_name, sizeof(our_object->file_name), "%s", fname); our_object->x_pos = x_pos; our_object->y_pos = y_pos; our_object->z_pos = z_pos; diff --git a/map_editor/Makefile.linux b/map_editor/Makefile.linux index 3fe7c24fd..63d793d1f 100644 --- a/map_editor/Makefile.linux +++ b/map_editor/Makefile.linux @@ -10,23 +10,38 @@ FEATURES += NEW_LIGHT_FORMAT FEATURES += ZLIB FEATURES += ZLIBW -WARN = -Wall -Wdeclaration-after-statement # -W -Werror -CXXWARN = -Wall # -W -Werror -OPTIONS = -DLINUX -DMAP_EDITOR $(foreach FEATURE, $(FEATURES), -D$(FEATURE)) -D_7ZIP_ST -OPTIONS += -DGL_GLEXT_PROTOTYPES # needed in my SDL_opengl.h for some function declarations - -GTK_CFLAGS = $(shell gtk-config --cflags) #If you wish to use the old gtk, compile with "make gtk" -GTK2_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags) -DGTK2 - -CFLAGS=$(OPTIONS) $(GTK2_CFLAGS) $(shell sdl-config --cflags) $(shell xml2-config --cflags) -g $(WARN) -_CFLAGS=$(OPTIONS) -mcpu=i686 -O3 -fomit-frame-pointer -ffast-math -pipe $(GTK_CFLAGS) $(shell sdl-config --cflags) $(shell sdl-config --cflags) $(shell xml2-config --cflags) -CXXFLAGS=$(OPTIONS) $(GTK2_CFLAGS) $(shell sdl-config --cflags) $(shell xml2-config --cflags) -g $(CXXWARN) -_CXXFLAGS=$(OPTIONS) -mcpu=i686 -O3 -fomit-frame-pointer -ffast-math -pipe $(GTK_CFLAGS) $(shell sdl-config --cflags) $(shell sdl-config --cflags) $(shell xml2-config --cflags) - -GTK_LIBS = $(shell gtk-config --libs) -GTK2_LIBS = $(shell pkg-config gtk+-2.0 --libs) - -LIBS=$(shell sdl-config --libs) -lGL -lGLU $(shell xml2-config --libs) -lcal3d -lSDL_image -lz +PLATFORM=-march=native +CWARN=-Wall -Wdeclaration-after-statement +CXXWARN=-Wall +EXTRA_INCLUDES= + +OPTIONS = -DLINUX -DMAP_EDITOR $(foreach FEATURE, $(FEATURES), -D$(FEATURE)) -D_7ZIP_ST \ + $(shell pkg-config gtk+-2.0 --cflags) -DGTK2 \ + $(shell pkg-config sdl --cflags) \ + $(shell pkg-config SDL_image --cflags) \ + $(shell pkg-config libxml-2.0 --cflags) \ + $(shell pkg-config cal3d --cflags) \ + $(shell pkg-config gl --cflags) \ + $(shell pkg-config glu --cflags) \ + $(shell pkg-config zlib --cflags) + +CFLAGS=$(PLATFORM) $(CWARN) -O0 -ggdb -pipe $(OPTIONS) -fno-strict-aliasing $(EXTRA_INCLUDES) + +CXXFLAGS=$(PLATFORM) $(CXXWARN) -O0 -ggdb -pipe $(OPTIONS) -fno-strict-aliasing $(EXTRA_INCLUDES) + +LDFLAGS=$(shell pkg-config sdl --libs) \ + $(shell pkg-config gtk+-2.0 --libs) \ + $(shell pkg-config libxml-2.0 --libs) \ + $(shell pkg-config SDL_image --libs) \ + $(shell pkg-config cal3d --libs) \ + $(shell pkg-config gl --libs) \ + $(shell pkg-config glu --libs) \ + $(shell pkg-config zlib --libs) \ + $(shell pkg-config x11 --libs) -lm -lstdc++ + +_CFLAGS=$(PLATFORM) -O2 -fomit-frame-pointer -ffast-math -pipe $(OPTIONS) -fno-strict-aliasing $(EXTRA_INCLUDES) +_LDFLAGS=$(XDIR) -lGL -lpthread -lstdc++ +_CXXFLAGS=$(PLATFORM) -O3 -fomit-frame-pointer -ffast-math -pipe $(OPTIONS) -fno-strict-aliasing $(EXTRA_INCLUDES) COBJS=2d_objects.o 3d_objects.o \ browser.o draw_scene.o \ @@ -77,6 +92,17 @@ ELC_XZ_CCOBJS = 7zCrc.o 7zCrcOpt.o Alloc.o Bra86.o Bra.o BraIA64.o \ OBJS = $(COBJS) $(CXXOBJS) $(ELC_COBJS) $(ELC_CXXOBJS) $(ELC_IO_COBJS) $(ELC_IO_CXXOBJS) \ $(ELC_EC_CXXOBJS) $(ELC_EXCEPTION_CXXOBJS) $(ELC_ENGINE_CXXOBJS) $(ELC_XZ_CCOBJS) +DEP_FILES=$(foreach OBJ, $(COBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(CXXOBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_COBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_IO_COBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_IO_CXXOBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_EXCEPTION_CXXOBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_CXXOBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_EC_CXXOBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_ENGINE_CXXOBJS), .deps/$(OBJ).P) \ + $(foreach OBJ, $(ELC_XZ_CCOBJS), .deps/$(OBJ).P) + EXE=mapedit.x86.linux.bin GENDEP=Makefile.linux @@ -85,57 +111,90 @@ all: $(EXE) $(EXE): $(OBJS) @echo " LINK $(EXE)" - @$(LINK) $(CFLAGS) -o $@ $^ $(LIBS) $(GTK2_LIBS) + @$(LINK) $(CFLAGS) -o $(EXE) $(OBJS) $(LDFLAGS) release: - make -f Makefile.linux 'CFLAGS=$(_CFLAGS)' + @$(MAKE) -f Makefile.linux 'CFLAGS=$(_CFLAGS)' 'CXXFLAGS=$(_CXXFLAGS)' -gtk: - make -f Makefile.linux 'GTK2_CFLAGS=$(GTK_CFLAGS)' 'GTK2_LIBS=$(GTK_LIBS)' +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) $(COBJS): %.o: %.c $(GENDEP) @echo " CC $@" - @$(CC) $(CFLAGS) -c -o $@ $< + @if $(CC) $(CFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(CXXOBJS): %.o : %.cpp $(GENDEP) @echo " CXX $@" - @$(CXX) $(CXXFLAGS) -c -o $@ $< + @if $(CXX) $(CXXFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_COBJS): %.o : ../%.c $(GENDEP) @echo " ELC CC $@" - @$(CC) $(CFLAGS) -c -o $@ $< + @if $(CC) $(CFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_IO_COBJS): %.o : ../io/%.c $(GENDEP) @echo " ELC IO CC $@" - @$(CC) $(CFLAGS) -c -o $@ $< + @if $(CC) $(CFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_IO_CXXOBJS): %.o : ../io/%.cpp $(GENDEP) @echo " ELC IO CXX $@" - @$(CXX) $(CXXFLAGS) -c -o $@ $< + @if $(CXX) $(CXXFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_EXCEPTION_CXXOBJS): %.o : ../exceptions/%.cpp $(GENDEP) @echo " ELC EXC CXX $@" - @$(CXX) $(CXXFLAGS) -c -o $@ $< + @if $(CXX) $(CXXFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_CXXOBJS): %.o : ../%.cpp $(GENDEP) @echo " ELC CXX $@" - @$(CXX) $(CXXFLAGS) -c -o $@ $< + @if $(CXX) $(CXXFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_EC_CXXOBJS): %.o : ../eye_candy/%.cpp $(GENDEP) @echo " ELC EC CXX $@" - @$(CXX) $(CXXFLAGS) -c -o $@ $< + @if $(CXX) $(CXXFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_ENGINE_CXXOBJS): %.o : ../engine/%.cpp $(GENDEP) @echo " ELC ENG CXX $@" - @$(CXX) $(CXXFLAGS) -c -o $@ $< + @if $(CXX) $(CXXFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi $(ELC_XZ_CCOBJS): %.o : ../xz/%.c $(GENDEP) @echo " ELC XZ CC $@" - @$(CC) $(CFLAGS) -c -o $@ $< + @if $(CC) $(CFLAGS) -MT '$@' -MD -MP -MF '.deps/$@.pp' -c $< -o $@; then \ + mv ".deps/$@.pp" ".deps/$@.P"; \ + else rm -f ".deps/$@.pp"; exit 1; \ + fi clean: -rm -f $(OBJS) $(EXE) +.depend: $(foreach HEADER_DIR, $(HEADER_DIRS), $(wildcard $(HEADER_DIR)/*.h)) + $(CC) $(CFLAGS) -MM $(patsubst %.o, %.c, $(COBJS)) >.depend + $(CXX) $(CXXFLAGS) -MM $(patsubst %.o, %.cpp, $(CXXOBJS)) >>.depend + # Based on the main client static build, this works on Ubuntu 8.04 (LTS) at least # Its only a little bit static but it may work # Install these packages in addition to those required for a standard build @@ -154,3 +213,5 @@ STATICLIBS=$(LIBD)/libSDL_net.a $(LIBD)/libSDL.a $(LIBD)/libSDL_image.a \ static: $(OBJS) @$(MAKE) -f Makefile.linux 'LIBS=$(STATICLIBS)' + +-include $(DEP_FILES) diff --git a/map_editor/browser.c b/map_editor/browser.c index 1f1e0f5ce..968dd20ef 100644 --- a/map_editor/browser.c +++ b/map_editor/browser.c @@ -20,7 +20,7 @@ int dc=-1,cd=-1,cp=0,cc=-1,mc=1,ccat=0; int setobject(int n, char *fn,float xrot, float yrot, float zrot) { object3d *our_object=&o3d[n]; - snprintf(our_object->file_name,80,"%s",fn); + snprintf(our_object->file_name,sizeof(our_object->file_name),"%s",fn); our_object->e3d_data = NULL; our_object->e3d_data=load_e3d_cache(fn); @@ -362,7 +362,11 @@ void init_browser() } line = 1; while(!feof(fp)){ - fgets(temp,511,fp); + if (fgets(temp,511,fp) == NULL) + { + log_error(__FILE__, __LINE__, "browser.lst red error"); + return; + } if(!strncmp(temp,"Category",8)){ cc++; strcpy(Cat[cc].Name,&temp[9]); diff --git a/map_editor/gui.c b/map_editor/gui.c index 7fcf32ce1..df09dd6d9 100644 --- a/map_editor/gui.c +++ b/map_editor/gui.c @@ -122,6 +122,18 @@ void hide_open_win(GtkWidget * widget, GtkWidget * win) gtk_widget_hide(win); } +static void check_escape(GtkWidget *widget, GdkEventKey *event, gpointer data) +{ + if (gtk_open_win && event->keyval == GDK_KEY_Escape) + gtk_widget_hide(gtk_open_win); +} + +static void kill_window(GtkWidget *widget, GdkEvent *event, gpointer data) +{ + if (gtk_open_win) + gtk_widget_hide(gtk_open_win); +} + void show_open_window(char * name, char * folder, GtkFileFilter * filter) { if(!gtk_open_win) { @@ -139,6 +151,8 @@ void show_open_window(char * name, char * folder, GtkFileFilter * filter) g_signal_connect ((gpointer) cancel, "clicked", G_CALLBACK (hide_open_win), gtk_open_win); g_signal_connect ((gpointer) ok_button, "clicked", G_CALLBACK (open_button_clicked), NULL); + g_signal_connect(gtk_open_win, "key_press_event", G_CALLBACK(check_escape), NULL); + g_signal_connect(gtk_open_win, "delete_event", G_CALLBACK(kill_window), NULL); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(gtk_open_win), e3d_filter); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(gtk_open_win), e2d_filter); diff --git a/map_editor/init.c b/map_editor/init.c index ae1da39fa..3fd9604c4 100644 --- a/map_editor/init.c +++ b/map_editor/init.c @@ -70,8 +70,12 @@ void init_stuff() int i; int seed; - chdir(DATA_DIR); - + if (chdir(DATA_DIR) != 0) + { + LOG_ERROR("Failed to set directory [%s]", DATA_DIR); + exit (1); + } + #ifndef WINDOWS setlocale(LC_NUMERIC,"en_US"); #endif diff --git a/map_editor/interface.c b/map_editor/interface.c index 1dfccd8cb..17bcbe55d 100644 --- a/map_editor/interface.c +++ b/map_editor/interface.c @@ -298,7 +298,7 @@ void draw_toolbar() void draw_3d_obj_info() { - unsigned char str[128]; + unsigned char str[200]; int x_menu,y_menu; if (cur_mode!=mode_3d || selected_3d_object==-1 || objects_list[selected_3d_object] == NULL) return; diff --git a/minimap.c b/minimap.c index 047bce144..0a66ac960 100644 --- a/minimap.c +++ b/minimap.c @@ -224,7 +224,7 @@ static __inline__ void draw_actor_points(window_info *win, float zoom_multip, fl glDisable(GL_TEXTURE_2D); rotate_actor_points(zoom_multip,px,py); glBegin(GL_LINES); - glColor3f(1.0f,0.0f,1.0f); //purple + elglColourN("minimap.cross"); glVertex2f(x-diff, y-diff); glVertex2f(x+diff, y+diff); glVertex2f(x-diff, y+diff); diff --git a/multiplayer.c b/multiplayer.c index f76bc970f..b4142bf71 100644 --- a/multiplayer.c +++ b/multiplayer.c @@ -312,7 +312,8 @@ static int my_locked_tcp_flush(TCPsocket my_socket) int my_tcp_send (TCPsocket my_socket, const Uint8 *str, int len) { - Uint8 new_str[1024]; //should be enough + Uint8 *new_str = NULL; + int ret_status = 0; CHECK_AND_LOCK_MUTEX(tcp_out_data_mutex); @@ -423,15 +424,19 @@ int my_tcp_send (TCPsocket my_socket, const Uint8 *str, int len) CHECK_AND_UNLOCK_MUTEX(tcp_out_data_mutex); + if ((new_str = (Uint8 *)malloc(3 + len - 1)) == NULL) + return 0; new_str[0] = str[0]; //copy the protocol byte *((short *)(new_str+1)) = SDL_SwapLE16((Uint16)len);//the data length // copy the rest of the data memcpy(&new_str[3], &str[1], len-1); #ifdef OLC - return olc_tcp_send(my_socket, new_str, len+2); + ret_status = olc_tcp_send(my_socket, new_str, len+2); #else //OLC - return SDLNet_TCP_Send(my_socket, new_str, len+2); + ret_status = SDLNet_TCP_Send(my_socket, new_str, len+2); #endif //OLC + free(new_str); + return ret_status; } int my_tcp_flush(TCPsocket my_socket) diff --git a/named_colours.cpp b/named_colours.cpp index 98a1a2b25..e642b899c 100644 --- a/named_colours.cpp +++ b/named_colours.cpp @@ -180,6 +180,7 @@ namespace ELGL_Colour add("minimap.mine", Colour_Tuple(0.15f, 0.65f, 0.45f)); add("minimap.servermark", Colour_Tuple(0.33f,0.6f,1.0f)); add("minimap.otherplayer", Colour_Tuple(1.0f, 1.0f, 1.0f)); + add("minimap.cross", Colour_Tuple(1.0f, 0.0f, 1.0f)); add("global.mousehighlight", Colour_Tuple(0.5f, 0.5f, 1.0f)); add("global.mouseselected", Colour_Tuple(0.4f, 0.8f, 1.0f)); add("buff.duration.background", Colour_Tuple(0.1f, 0.3f, 1.0f, 0.7f)); diff --git a/named_colours.xml b/named_colours.xml index f6c25efd2..8e854320c 100644 --- a/named_colours.xml +++ b/named_colours.xml @@ -12,6 +12,7 @@ + diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index bb107a785..e54ca423c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: eternallands -version: '1.9.5.git' +version: '1.9.5.p3' summary: Eternal Lands is a free to play, graphical MMORPG description: | Eternal Lands is a free to play, graphical MMORPG (massively-multi-player @@ -14,15 +14,16 @@ icon: pkgfiles/snap-package/eternallands.png parts: client: - source: https://github.com/raduprv/Eternal-Lands/archive/master.zip + source: https://github.com/raduprv/Eternal-Lands + source-type: git + source-tag: 1.9.5.3 build-packages: [build-essential, libcal3d12-dev, libsdl-image1.2-dev, libsdl-net1.2-dev, libxml2-dev, libopenal-dev, libvorbis-dev] plugin: make - source-subdir: "Eternal-Lands-master" makefile: Makefile.linux make-parameters: ["release", "PLATFORM=''", "EXE=el.linux.bin"] override-pull: | snapcraftctl pull - cd Eternal-Lands-master/ && echo "1.9.5.git-`date +"%Y%m%d%H%M"`" > git_version + sed -i 's|^PLATFORM=.*$|#PLATFORM=""|g' make.defaults artifacts: ["el.linux.bin"] stage-packages: - libglib2.0-0 diff --git a/translate.c b/translate.c index 4797ff368..600546e42 100644 --- a/translate.c +++ b/translate.c @@ -185,6 +185,8 @@ char /*gamewin.c*/ ranginglock_enabled_str[100], ranginglock_disabled_str[50], + close_click_targetting_on_str[50], + close_click_targetting_off_str[50], /*gl_init.c*/ window_size_adjusted_str[50], /*hud.c*/ @@ -732,6 +734,7 @@ char reg_error_str[15], /* encyclopedia */ cant_load_encycl[70], /* text.c */ + invalidnpcmark_str[50], warn_currently_ignoring[50]; #else ; @@ -1242,6 +1245,7 @@ void init_errors() add_xml_identifier (misc, "noanimation", no_animation_err_str, "No animation: %s!\n", sizeof(no_animation_err_str)); add_xml_identifier (misc, "invalid_location", invalid_location_str, "Invalid location %d,%d", sizeof(invalid_location_str)); add_xml_identifier (misc, "warn_currently_ignoring", warn_currently_ignoring, "Warning: %s is on your #ignore list", sizeof(warn_currently_ignoring)); + add_xml_identifier (misc, "invalidnpcmark", invalidnpcmark_str, "Invalid string for NPC map mark.", sizeof(invalidnpcmark_str)); //XML errors. should these have their own group? add_xml_identifier (misc, "badnode", xml_bad_node, "There is something wrong with one of a node's fields.", sizeof(xml_bad_node)); @@ -1494,6 +1498,8 @@ void init_help() add_xml_identifier(misc,"note_save_failed",note_save_failed,"Failed to save your notes!",sizeof(note_save_failed)); add_xml_identifier(misc,"ranginglock_enabled",ranginglock_enabled_str,"Ranging-Lock is now enabled. Disable it or unequip ranging weapon before walking.",sizeof(ranginglock_enabled_str)); add_xml_identifier(misc,"ranginglock_disabled",ranginglock_disabled_str,"Ranging-Lock is now disabled.",sizeof(ranginglock_disabled_str)); + add_xml_identifier(misc,"close_click_targetting_on",close_click_targetting_on_str,"Close-click targetting on.",sizeof(close_click_targetting_on_str)); + add_xml_identifier(misc,"close_click_targetting_off",close_click_targetting_off_str,"Close-click targetting off.",sizeof(close_click_targetting_off_str)); add_xml_identifier(misc,"video_restart", video_restart_str, "Video change will take effect at next restart.", sizeof(video_restart_str)); add_xml_identifier(misc,"rotate_chat_log_restart", rotate_chat_log_restart_str, "Rotate chat log change will take effect at next restart.", sizeof(rotate_chat_log_restart_str)); add_xml_identifier(misc,"ranging_win_title", ranging_win_title_str, "Ranging", sizeof(ranging_win_title_str)); diff --git a/translate.h b/translate.h index 885e848ed..e8f2e8268 100644 --- a/translate.h +++ b/translate.h @@ -310,6 +310,8 @@ extern char /*gamewin.c*/ ranginglock_enabled_str[100], ranginglock_disabled_str[50], + close_click_targetting_on_str[50], + close_click_targetting_off_str[50], /*gl_init.c*/ window_size_adjusted_str[50], /*hud.c*/ @@ -811,6 +813,7 @@ extern char reg_error_str[15], fatal_data_error[120], cant_load_encycl[70], warn_currently_ignoring[50], + invalidnpcmark_str[50], dc_note_remove[50], note_saved[50], note_save_failed[50];