From b09adfb92c10687c52bb38a528f67e19b0ba4daa Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 14 Dec 2013 23:11:27 +0000 Subject: [PATCH] [Fix] Ton more fixes. F*CK YOU XML! --- bin/Makefile | 17 +++---- dat/mission.xml | 84 ++++++++++++++++++++----------- dat/missions/emp_collective06.lua | 4 +- src/space.c | 8 ++- src/xml.h | 3 +- 5 files changed, 70 insertions(+), 46 deletions(-) diff --git a/bin/Makefile b/bin/Makefile index 1c1b399..04cb1ee 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -27,15 +27,6 @@ CTTF = $(shell freetype-config --cflags) CGL = CFLAGS = $(CLUA) $(CSDL) $(CXML) $(CTTF) $(CGL) $(VERSION) -D$(OS) -# LDFLAGS. -LDLUA = ../lib/lua/liblua.a -LDSDL = $(shell sdl-config --libs) -lSDL_image -lSDL_mixer -LDXML = $(shell xml2-config --libs) -LDTTF = $(shell freetype-config --libs) -LDGL = -lGL -LDPNG = -lpng -LDFLAGS = -lm $(LDLUA) $(LDSDL) $(LDXML) $(LDTTF) $(LDGL) $(LDPNG) - # OS Stuff. ifeq ($(OS),LINUX) CFLAGS += -D_POSIX_SOURCE @@ -60,6 +51,14 @@ else # DEBUG CFLAGS += -O2 -funroll-loops -pipe -std=c99 endif +# LDFLAGS. +LDLUA = ../lib/lua/liblua.a +LDSDL = $(shell sdl-config --libs) -lSDL_image -lSDL_mixer +LDXML = $(shell xml2-config --libs) +LDTTF = $(shell freetype-config --libs) +LDGL = -lGL +LDPNG = -lpng +LDFLAGS = -lm $(LDLUA) $(LDSDL) $(LDXML) $(LDTTF) $(LDGL) $(LDPNG) # This is just for gstat to run some analysis on performance. ifdef DEBUG diff --git a/dat/mission.xml b/dat/mission.xml index 77eb33f..af013bd 100644 --- a/dat/mission.xml +++ b/dat/mission.xml @@ -33,7 +33,7 @@ es_cargo - player.getFaction("Empire") >=0 and var.peek("es_cargo") == true + player.getFaction("Empire") >= 0 and var.peek("es_cargo") == true 350 Computer Empire @@ -46,7 +46,7 @@ 1 - var.peek("es_cargo") == true and space.getSystem("NGC-7291"):jumpDist() < 5 and player.getFaction("Empire") > 5 and player.getRating() > 5 + var.peek("es_cargo") == true and space.getSystem("NGC-7291"):jumpDist() < 5 and player.getFaction("Empire") > 5 and player.getRating() > 5 80 Bar Empire @@ -77,31 +77,57 @@ Bar Omega Station - - - emp_collective05 - - 1 - - - player.getFaction("Empire") > 5 - Collective Distraction - 100 - Bar - Omega Station - - - - emp_collective06 - - 1 - - - player.getFaction("Empire") > 5 - Operation Black Trinity - 100 - Bar - Omega Station - - + + + emp_collective03 + + 1 + + + player.getFaction("Empire") > 5 + Collective Espionage 2 + 100 + Bar + Omega Station + + + + emp_collective04 + + 1 + + + player.getFaction("Empire") > 5 and var.peek("emp_commando") ~= nil and time.get() > var.peek("emp_commando") + Collective Espionage 3 + 100 + Land + Omega Station + + + + emp_collective05 + + 1 + + + player.getFaction("Empire") > 5 + Collective Distraction + 100 + Bar + Omega Station + + + + emp_collective06 + + 1 + + + player.getFaction("Empire") > 5 + Operation Black Trinity + 100 + Bar + Omega Station + + diff --git a/dat/missions/emp_collective06.lua b/dat/missions/emp_collective06.lua index 0d8cf70..0f66a4c 100644 --- a/dat/missions/emp_collective06.lua +++ b/dat/missions/emp_collective06.lua @@ -94,7 +94,7 @@ function jump() emp_fleets = {} emp_fleets[1] = "Empire Sml Attack" emp_fleets[2] = "Empire Sml Attack" - emp_fleets[3] = "Dvaered Goddard" -- They help empire. + emp_fleets[3] = "Draktharr Goddard" -- They help empire. for k,v in ipairs(emp_fleets) do enter_vect:add( rnd.int(-500,500), rnd.int(-500,500) ) pilot.add( v, "def", enter_vect ) @@ -132,7 +132,7 @@ function jump() emp_fleets = {} emp_fleets[1] = "Empire Lge Attack" emp_fleets[2] = "Empire Med Attack" - emp_fleets[3] = "Dvaered Goddard" -- They help empire. + emp_fleets[3] = "Draktharr Goddard" -- They help empire. for k,v in ipairs(emp_fleets) do enter_vect:add( rnd.int(-500,500), rnd.int(-500,500) ) pilot.add( v, "def", enter_vect ) diff --git a/src/space.c b/src/space.c index f8379b3..66538e4 100644 --- a/src/space.c +++ b/src/space.c @@ -8,16 +8,14 @@ #include "physics.h" #include "rng.h" #include "pack.h" -#include "space.h" -#include "faction.h" -#include "xml.h" +#include "player.h" #include "pause.h" #include "weapon.h" #include "toolkit.h" #include "spfx.h" #include "ltime.h" #include "nebulae.h" -#include "player.h" +#include "space.h" #define XML_PLANET_ID "Planets" #define XML_PLANET_TAG "planet" @@ -86,7 +84,7 @@ static int planet_parse(Planet* planet, const xmlNodePtr parent); /* System load. */ static int systems_load(void); static StarSystem* system_parse(StarSystem* system, const xmlNodePtr parent); -static void systemJumps(const xmlNodePtr parent); +static void system_parseJumps(const xmlNodePtr parent); /* Misc. */ static void system_setFaction(StarSystem* sys); static void space_renderStars(const double dt); diff --git a/src/xml.h b/src/xml.h index 7771dc2..ddd9628 100644 --- a/src/xml.h +++ b/src/xml.h @@ -9,7 +9,8 @@ #define XML_NODE_TEXT 3 /* Check if node n is of name s. */ -#define xml_isNode(n,s) (((n)->type == XML_NODE_START) && \ +#define xml_isNode(n,s) \ + ((n!=NULL) && ((n)->type==XML_NODE_START) && \ (strcmp((char*)(n)->name, s)==0)) /* Get the next node. */