[Fix] Ton more fixes. F*CK YOU XML!

This commit is contained in:
Allanis 2013-12-14 23:11:27 +00:00
parent fbdb944f88
commit b09adfb92c
5 changed files with 70 additions and 46 deletions

View File

@ -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

View File

@ -78,6 +78,32 @@
<planet>Omega Station</planet>
</avail>
</mission>
<mission name="Collective Espionage 3">
<lua>emp_collective03</lua>
<flags>
<unique>1</unique>
</flags>
<avail>
<cond>player.getFaction("Empire") &gt; 5</cond>
<done>Collective Espionage 2</done>
<chance>100</chance>
<location>Bar</location>
<planet>Omega Station</planet>
</avail>
</mission>
<mission name="Collective Distraction">
<lua>emp_collective04</lua>
<flags>
<unique>1</unique>
</flags>
<avail>
<cond>player.getFaction("Empire") &gt; 5 and var.peek("emp_commando") ~= nil and time.get() &gt; var.peek("emp_commando")</cond>
<done>Collective Espionage 3</done>
<chance>100</chance>
<location>Land</location>
<planet>Omega Station</planet>
</avail>
</mission>
<mission name="Operation Black Trinity">
<lua>emp_collective05</lua>
<flags>
@ -91,7 +117,7 @@
<planet>Omega Station</planet>
</avail>
</mission>
<mission>
<mission name="Operation Cold Metal">
<lua>emp_collective06</lua>
<flags>
<unique>1</unique>

View File

@ -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 )

View File

@ -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);

View File

@ -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. */