diff --git a/dat/outfit.xml b/dat/outfit.xml index 8e9db07..95eb030 100644 --- a/dat/outfit.xml +++ b/dat/outfit.xml @@ -5,6 +5,7 @@ 5 2 0 + 5000 lasergreen @@ -25,6 +26,7 @@ 2 4 10 + 25000 Missile @@ -36,6 +38,7 @@ 60 2 1 + 800 missile diff --git a/dat/ship.xml b/dat/ship.xml index 0121e95..d178302 100644 --- a/dat/ship.xml +++ b/dat/ship.xml @@ -5,6 +5,7 @@ minimal engine 1 + 120000 320 150 @@ -33,6 +34,7 @@ minimal engine 1 + 180000 400 180 @@ -61,6 +63,7 @@ minimal engine 2 + 600000 320 150 diff --git a/src/outfit.c b/src/outfit.c index 318888a..7c810f4 100644 --- a/src/outfit.c +++ b/src/outfit.c @@ -242,8 +242,9 @@ static Outfit* outfit_parse(const xmlNodePtr parent) { cur = node->children; do { if(xml_isNode(cur, "max")) tmp->max = xml_getInt(cur); - else if(xml_isNode(cur, "tech")) tmp->tech = xml_getInt(cur); - else if(xml_isNode(cur, "mass")) tmp->mass = xml_getInt(cur); + else if(xml_isNode(cur, "tech")) tmp->tech = xml_getInt(cur); + else if(xml_isNode(cur, "mass")) tmp->mass = xml_getInt(cur); + else if(xml_isNode(cur, "price")) tmp->price = xml_getInt(cur); } while((cur = cur->next)); } else if(xml_isNode(node, "specific")) { @@ -276,8 +277,9 @@ static Outfit* outfit_parse(const xmlNodePtr parent) { MELEMENT(tmp->name==NULL, "name"); MELEMENT(tmp->max==0, "max"); MELEMENT(tmp->tech==0, "tech"); - // MELEMENT(tmp->mass==0, "mass"); + //MELEMENT(tmp->mass==0, "mass"); MELEMENT(tmp->type==0, "type"); + MELEMENT(tmp->price==0, "price"); #undef MELEMENT return tmp; diff --git a/src/outfit.h b/src/outfit.h index a65822d..7978acc 100644 --- a/src/outfit.h +++ b/src/outfit.h @@ -31,6 +31,7 @@ typedef struct Outfit_ { int max; int tech; int mass; + unsigned int price; glTexture gfx_store; // Store graphic. diff --git a/src/ship.c b/src/ship.c index a83e934..81cd53c 100644 --- a/src/ship.c +++ b/src/ship.c @@ -80,7 +80,9 @@ static Ship* ship_parse(xmlNodePtr parent) { else if(xml_isNode(node, "sound")) tmp->sound = sound_get(xml_get(node)); else if(xml_isNode(node, "class")) - tmp->class = atoi(xml_get(node)); + tmp->class = xml_getInt(node); + else if(xml_isNode(node, "price")) + tmp->price = xml_getInt(node); else if(xml_isNode(node, "movement")) { cur = node->children; do { @@ -151,6 +153,8 @@ static Ship* ship_parse(xmlNodePtr parent) { MELEMENT(tmp->name == NULL, "name"); MELEMENT(tmp->gfx_space == NULL, "GFX"); MELEMENT(tmp->gui == NULL, "GUI"); + MELEMENT(tmp->class==0, "class"); + MELEMENT(tmp->price==0, "price"); MELEMENT(tmp->thrust==0, "thrust"); MELEMENT(tmp->turn==0, "turn"); MELEMENT(tmp->speed==0, "speed"); diff --git a/src/ship.h b/src/ship.h index 8c71d22..c6d1778 100644 --- a/src/ship.h +++ b/src/ship.h @@ -27,6 +27,8 @@ typedef struct Ship_ { char* name; // Ship name. ShipClass class; // Ship class. + unsigned int price; // Price! + // Movement. double thrust, turn, speed;