From 55e5fefd484d0b8c2588c3d51719efcbeca9bc45 Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Thu, 9 Oct 2003 19:04:30 +0000
Subject: [PATCH] Cleanup

---
 src/stratagus/missile.cpp    |  8 ++++----
 src/unit/script_unittype.cpp |  4 ++--
 src/unit/unittype.cpp        | 20 +++++++++++++++-----
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/stratagus/missile.cpp b/src/stratagus/missile.cpp
index 8a31d38f4..ff4e38bc9 100644
--- a/src/stratagus/missile.cpp
+++ b/src/stratagus/missile.cpp
@@ -466,13 +466,13 @@ local int CalculateDamageStats(const UnitStats* attacker_stats,
 	damage -= SyncRand() % ((damage + 2) / 2);
     }
 #else
-    damage = max(basic_damage-goal_stats->Armor,1)+piercing_damage;
-    damage -= SyncRand() % ((damage+2)/2);
-    DebugCheck(damage<0);
+    damage = max(basic_damage - goal_stats->Armor, 1) + piercing_damage;
+    damage -= SyncRand() % ((damage + 2) / 2);
+    DebugCheck(damage < 0);
 #endif
 	
     DebugLevel3Fn("\nDamage done [%d] %d %d ->%d\n" _C_ goal_stats->Armor _C_
-	    basic_damage _C_ piercing_damage _C_ damage);
+	basic_damage _C_ piercing_damage _C_ damage);
 
     return damage;
 }
diff --git a/src/unit/script_unittype.cpp b/src/unit/script_unittype.cpp
index 2169ae3e4..c45a055bf 100644
--- a/src/unit/script_unittype.cpp
+++ b/src/unit/script_unittype.cpp
@@ -519,12 +519,12 @@ local SCM CclDefineUnitType(SCM list)
 	    }
 	    sublist = gh_car(list);
 	    list = gh_cdr(list);
-	    type->Magic=0;
+	    type->Magic = 0;
 	    while (!gh_null_p(sublist)) {
 		DebugLevel3Fn("%d \n" _C_ CclGetSpellByIdent(gh_car(sublist)));
 		type->CanCastSpell[CclGetSpellByIdent(gh_car(sublist))] = 1;
 		sublist = gh_cdr(sublist);
-		type->Magic=1;
+		type->Magic = 1;
 	    }
 	} else if (gh_eq_p(value, gh_symbol2scm("organic"))) {
 	    type->Organic = 1;
diff --git a/src/unit/unittype.cpp b/src/unit/unittype.cpp
index 79fe85509..d090c47b1 100644
--- a/src/unit/unittype.cpp
+++ b/src/unit/unittype.cpp
@@ -381,10 +381,12 @@ global void ParsePudUDTA(const char* udta, int length __attribute__((unused)))
 	v = Fetch8(udta);
 	unittype->_PiercingDamage = v;
     }
-    /*
-     * This is not used in stratagus. so it was simply removed.
-     * We use our own upgrade methods that are a lot more flexible.
-     * Maybe we could use this one day, not sure.
+    //
+    // This is not used in stratagus. so it was simply removed.
+    // We use our own upgrade methods that are a lot more flexible.
+    // Maybe we could use this one day, not sure.
+    //
+#if 0
     for (i = 0; i < 110; ++i) {		// Weapons upgradable
 	unittype = UnitTypeByWcNum(i);
 	v = Fetch8(udta);
@@ -394,7 +396,15 @@ global void ParsePudUDTA(const char* udta, int length __attribute__((unused)))
 	unittype = UnitTypeByWcNum(i);
 	v = Fetch8(udta);
 	unittype->ArmorUpgradable = v;
-    }*/
+    }
+#else
+    for (i = 0; i < 110; ++i) {		// Skip weapons upgradable
+	Fetch8(udta);
+    }
+    for (i = 0; i < 110; ++i) {		// Skip armor upgradable
+	Fetch8(udta);
+    }
+#endif
     for (i = 0; i < 110; ++i) {		// Missile Weapon
 	unittype = UnitTypeByWcNum(i);
 	v = Fetch8(udta);