From 2b3852c25b7c63775745fb858169d4715a558345 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Fri, 15 Feb 2013 02:18:09 +0000
Subject: [PATCH] [Fix] Guess who found out the correct spelling of armour!  
 -- find . -iname \*.c -exec sed -i -e "s/armor/armour/g" {} \;

---
 src/ai.c     | 24 ++++++++++++------------
 src/outfit.c |  4 ++--
 src/pilot.c  | 32 ++++++++++++++++----------------
 src/player.c | 16 ++++++++--------
 src/ship.c   | 12 ++++++------
 src/weapon.c |  2 +-
 6 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/src/ai.c b/src/ai.c
index f43a299..a5b1d4a 100644
--- a/src/ai.c
+++ b/src/ai.c
@@ -90,9 +90,9 @@ static int ai_taskname(lua_State* L);           // Number taskname.
 // Consult values.
 static int ai_gettarget(lua_State* L);          // Pointer gettarget()
 static int ai_gettargetid(lua_State* L);        // Number gettargetis()
-static int ai_armor(lua_State* L);              // armor()
+static int ai_armour(lua_State* L);             // armour()
 static int ai_shield(lua_State* L);             // shield()
-static int ai_parmor(lua_State* L);             // parmor()
+static int ai_parmour(lua_State* L);            // parmour()
 static int ai_pshield(lua_State* L);            // pshield()
 static int ai_getdistance(lua_State* L);        // Number getdist(Vec2)
 static int ai_getpos(lua_State* L);             // getpos(number)
@@ -196,9 +196,9 @@ static int ai_loadProfile(char* filename) {
   // Consult.
   lua_register(L, "gettarget",          ai_gettarget);
   lua_register(L, "gettargetid",        ai_gettargetid);
-  lua_register(L, "armor",              ai_armor);
+  lua_register(L, "armour",             ai_armour);
   lua_register(L, "shield",             ai_shield);
-  lua_register(L, "parmor",             ai_parmor);
+  lua_register(L, "parmour",            ai_parmour);
   lua_register(L, "pshield",            ai_pshield);
   lua_register(L, "getdist",            ai_getdistance);
   lua_register(L, "getpos",             ai_getpos);
@@ -403,12 +403,12 @@ static int ai_gettargetid(lua_State* L) {
   return 0;
 }
 
-// Get the pilots armor.
-static int ai_armor(lua_State* L) {
+// Get the pilots armour.
+static int ai_armour(lua_State* L) {
   double d;
 
-  if(lua_isnumber(L,1)) d = pilot_get((unsigned int)lua_tonumber(L,1))->armor;
-  else d = cur_pilot->armor;
+  if(lua_isnumber(L,1)) d = pilot_get((unsigned int)lua_tonumber(L,1))->armour;
+  else d = cur_pilot->armour;
 
   lua_pushnumber(L, d);
   return 1;
@@ -425,16 +425,16 @@ static int ai_shield(lua_State* L) {
   return 1;
 }
 
-// Get the pilot's armor in percentage.
-static int ai_parmor(lua_State* L) {
+// Get the pilot's armour in percentage.
+static int ai_parmour(lua_State* L) {
   double d;
   Pilot* p;
   
   if(lua_isnumber(L,1)) {
     p = pilot_get((unsigned int)lua_tonumber(L,1));
-    d = p->armor / p->armor_max * 100.;
+    d = p->armour / p->armour_max * 100.;
   }
-  else d = cur_pilot->armor / cur_pilot->armor_max * 100.;
+  else d = cur_pilot->armour / cur_pilot->armour_max * 100.;
 
   lua_pushnumber(L, d);
   return 1;
diff --git a/src/outfit.c b/src/outfit.c
index 3f6b2f8..14b8fbd 100644
--- a/src/outfit.c
+++ b/src/outfit.c
@@ -92,7 +92,7 @@ static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) {
     else if(xml_isNode(node, "damage")) {
       cur = node->children;
       do {
-        if(xml_isNode(cur, "armor")) tmp->damage_armor = xml_getFloat(cur);
+        if(xml_isNode(cur, "armour")) tmp->damage_armour = xml_getFloat(cur);
         else if(xml_isNode(cur, "shield")) tmp->damage_shield = xml_getFloat(cur);
       } while((cur = cur->next));
     }
@@ -103,7 +103,7 @@ static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) {
   MELEMENT(tmp->speed,          "speed");
   MELEMENT(tmp->range,          "range");
   MELEMENT(tmp->accuracy,       "accuracy");
-  MELEMENT(tmp->damage_armor,   "armor' from element 'damage");
+  MELEMENT(tmp->damage_armour,  "armour' from element 'damage");
   MELEMENT(tmp->damage_shield,  "shield' from element 'damage");
 #undef MELEMENT
 }
diff --git a/src/pilot.c b/src/pilot.c
index e7376c9..bee6f44 100644
--- a/src/pilot.c
+++ b/src/pilot.c
@@ -131,18 +131,18 @@ void pilot_shoot(Pilot* p, const int secondary) {
 }
 
 // Damage the pilot.
-void pilot_hit(Pilot* p, const double damage_shield, const double damage_armor) {
+void pilot_hit(Pilot* p, const double damage_shield, const double damage_armour) {
   if(p->shield - damage_shield > 0.)
     p->shield -= damage_shield;
   else if(p->shield > 0.) {
     // Shields can take part of the blow.
-    p->armor -= p->shield/damage_shield*damage_armor;
+    p->armour -= p->shield/damage_shield*damage_armour;
     p->shield = 0.;
   }
-  else if(p->armor-damage_armor > 0.)
-    p->armor -= damage_armor;
+  else if(p->armour-damage_armour > 0.)
+    p->armour -= damage_armour;
   else
-    p->armor = 0.;
+    p->armour = 0.;
 }
 
 // Render the pilot.
@@ -157,7 +157,7 @@ void pilot_render(Pilot* p) {
 
 // Update the pilot.
 static void pilot_update(Pilot* pilot, const double dt) {
-  if(pilot != player && pilot->armor < PILOT_DISABLED_ARMOR * pilot->armor_max) { 
+  if(pilot != player && pilot->armour < PILOT_DISABLED_ARMOR * pilot->armour_max) { 
     // We are disabled.
     pilot_setFlag(pilot, PILOT_DISABLED);
     // Come to a halt slowly.
@@ -170,12 +170,12 @@ static void pilot_update(Pilot* pilot, const double dt) {
     return;
   }
   // We are still alive.
-  else if(pilot->armor < pilot->armor_max)
-    pilot->armor += pilot->ship->armor_regen*dt;
+  else if(pilot->armour < pilot->armour_max)
+    pilot->armour += pilot->ship->armour_regen*dt;
   else
     pilot->shield += pilot->ship->shield_regen*dt;
 
-  if(pilot->armor > pilot->armor_max) pilot->armor = pilot->armor_max;
+  if(pilot->armour > pilot->armour_max) pilot->armour = pilot->armour_max;
   if(pilot->shield > pilot->shield_max) pilot->shield = pilot->shield_max;
 
   // Update the solid.
@@ -217,13 +217,13 @@ void pilot_init(Pilot* pilot, Ship* ship, char* name, Faction* faction, AI_Profi
   // Solid.
   pilot->solid = solid_create(ship->mass, dir, pos, vel);
 
-  // Max shields armor.
-  pilot->armor_max  = ship->armor;
-  pilot->shield_max = ship->shield;
-  pilot->energy_max = ship->energy;
-  pilot->armor      = pilot->armor_max;
-  pilot->shield     = pilot->shield_max;
-  pilot->energy     = pilot->energy_max;
+  // Max shields armour.
+  pilot->armour_max   = ship->armour;
+  pilot->shield_max   = ship->shield;
+  pilot->energy_max   = ship->energy;
+  pilot->armour       = pilot->armour_max;
+  pilot->shield       = pilot->shield_max;
+  pilot->energy       = pilot->energy_max;
 
 
   // Initially idle.
diff --git a/src/player.c b/src/player.c
index bc830b4..b073641 100644
--- a/src/player.c
+++ b/src/player.c
@@ -106,7 +106,7 @@ typedef struct {
   gl_texture* gfx_targetPilot, *gfx_targetPlanet;
   Radar radar;
   Rect nav;
-  Rect shield, armor, energy;
+  Rect shield, armour, energy;
   Rect weapon;
   Rect misc;
 
@@ -114,7 +114,7 @@ typedef struct {
   Vec2 pos_frame;
   Vec2 pos_radar;
   Vec2 pos_nav;
-  Vec2 pos_shield, pos_armor, pos_energy;
+  Vec2 pos_shield, pos_armour, pos_energy;
   Vec2 pos_weapon;
   Vec2 pos_target, pos_target_health, pos_target_name, pos_target_faction;
   Vec2 pos_misc;
@@ -336,7 +336,7 @@ void player_render(void) {
 
   // Health
   gui_renderBar(&cShield, &gui.pos_shield, &gui.shield, player->shield / player->shield_max);
-  gui_renderBar(&cArmor,  &gui.pos_armor,  &gui.armor,  player->armor  / player->armor_max);
+  gui_renderBar(&cArmor,  &gui.pos_armour, &gui.armour, player->armour / player->armour_max);
   gui_renderBar(&cEnergy, &gui.pos_energy, &gui.energy, player->energy / player->energy_max);
   
   // Weapon.
@@ -369,8 +369,8 @@ void player_render(void) {
       // On shields.
       gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Shield", p->shield/p->shield_max*100.);
     else
-      // On armor.
-      gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Armor", p->armor/p->armor_max*100.);
+      // On armour.
+      gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Armor", p->armour/p->armour_max*100.);
   } else {
     // No target.
     i = gl_printWidth(NULL, "No Target");
@@ -662,9 +662,9 @@ static int gui_parse(const xmlNodePtr parent, const char* name) {
           VY(gui.pos_frame) + gui.gfx_frame->h - y);
         }
       
-        if(xml_isNode(cur, "armor")) {
-          rect_parse(cur, &x, &y, &gui.armor.w, &gui.armor.h);
-          vect_csetmin(&gui.pos_armor,
+        if(xml_isNode(cur, "armour")) {
+          rect_parse(cur, &x, &y, &gui.armour.w, &gui.armour.h);
+          vect_csetmin(&gui.pos_armour,
           VX(gui.pos_frame) + x,
           VY(gui.pos_frame) + gui.gfx_frame->h - y);
         }
diff --git a/src/ship.c b/src/ship.c
index b9e654f..0ee4738 100644
--- a/src/ship.c
+++ b/src/ship.c
@@ -75,14 +75,14 @@ static Ship* ship_parse(xmlNodePtr parent) {
     else if(strcmp((char*)node->name, "health")==0) {
       cur = node->children;
       do {
-        if(strcmp((char*)cur->name, "armor")==0)
-          tmp->armor = (double)atoi((char*)cur->children->content);
+        if(strcmp((char*)cur->name, "armour")==0)
+          tmp->armour = (double)atoi((char*)cur->children->content);
         else if(strcmp((char*)cur->name, "shield")==0)
           tmp->shield = (double)atoi((char*)cur->children->content);
         else if(strcmp((char*)cur->name, "energy")==0)
           tmp->energy = (double)atoi((char*)cur->children->content);
-        else if(strcmp((char*)cur->name, "armor_regen")==0)
-          tmp->armor_regen = (double)(atoi((char*)cur->children->content))/60.0;
+        else if(strcmp((char*)cur->name, "armour_regen")==0)
+          tmp->armour_regen = (double)(atoi((char*)cur->children->content))/60.0;
         else if(strcmp((char*)cur->name, "shield_regen")==0)
           tmp->shield_regen = (double)(atoi((char*)cur->children->content))/60.0;
         else if(strcmp((char*)cur->name, "energy_regen")==0)
@@ -135,8 +135,8 @@ static Ship* ship_parse(xmlNodePtr parent) {
   MELEMENT(tmp->speed,        "speed");
   MELEMENT(tmp->crew,         "crew");
   MELEMENT(tmp->mass,         "mass");
-  MELEMENT(tmp->armor,        "armor");
-  MELEMENT(tmp->armor_regen,  "armor_regen");
+  MELEMENT(tmp->armour,       "armour");
+  MELEMENT(tmp->armour_regen, "armour_regen");
   MELEMENT(tmp->shield,       "shield");
   MELEMENT(tmp->shield_regen, "shield_regen");
   MELEMENT(tmp->energy,       "energy");
diff --git a/src/weapon.c b/src/weapon.c
index 021375a..bea42cf 100644
--- a/src/weapon.c
+++ b/src/weapon.c
@@ -139,7 +139,7 @@ static void weapon_update(Weapon* w, const double dt, WeaponLayer layer) {
         pilot_setFlag(pilot_stack[i], PILOT_HOSTILE);
 
       // Inform the ship that it should take some damage.
-      pilot_hit(pilot_stack[i], w->outfit->damage_shield, w->outfit->damage_armor);
+      pilot_hit(pilot_stack[i], w->outfit->damage_shield, w->outfit->damage_armour);
       // No need for the weapon particle anymore.
       weapon_destroy(w, layer);
       return;