Permalink
Browse files

Always use latest armour upgrade value for already built droids.

This makes armour behave the same way for droids as for structures
and features, and in line with every other upgrade.
  • Loading branch information...
perim committed Nov 29, 2015
1 parent 3f2dd66 commit a1cb2afb6d31a4c54694ab828ab2cff0168dc981
Showing with 1 addition and 8 deletions.
  1. +1 −1 src/combat.cpp
  2. +0 −6 src/droid.cpp
  3. +0 −1 src/droiddef.h
View
@@ -345,7 +345,7 @@ int objArmour(BASE_OBJECT *psObj, WEAPON_CLASS weaponClass)
int armour = 0;
if (psObj->type == OBJ_DROID)
{
armour = ((DROID *)psObj)->armour[weaponClass];
armour = bodyArmour(asBodyStats + ((DROID *)psObj)->asBits[COMP_BODY], psObj->player, weaponClass);
}
else if (psObj->type == OBJ_STRUCTURE && weaponClass == WC_KINETIC && ((STRUCTURE *)psObj)->status != SS_BEING_BUILT)
{
View
@@ -1796,7 +1796,6 @@ DROID *reallyBuildDroid(DROID_TEMPLATE *pTemplate, Position pos, UDWORD player,
{
DROID *psDroid;
DROID_GROUP *psGrp;
UDWORD inc;
SDWORD i, experienceLoc;
// Don't use this assertion in single player, since droids can finish building while on an away mission
@@ -1868,11 +1867,6 @@ DROID *reallyBuildDroid(DROID_TEMPLATE *pTemplate, Position pos, UDWORD player,
ASSERT(psDroid->body > 0, "Invalid number of hitpoints");
psDroid->originalBody = psDroid->body;
for (inc = 0; inc < WC_NUM_WEAPON_CLASSES; inc++)
{
psDroid->armour[inc] = bodyArmour(asBodyStats + pTemplate->asParts[COMP_BODY], player, (WEAPON_CLASS)inc);
}
/* Set droid's initial illumination */
psDroid->sDisplay.imd = BODY_IMD(psDroid, psDroid->player);
View
@@ -104,7 +104,6 @@ struct DROID : public BASE_OBJECT
uint32_t experience;
UDWORD lastFrustratedTime; ///< Set when eg being stuck; used for eg firing indiscriminately at map features to clear the way
SWORD resistance; ///< used in Electronic Warfare
UDWORD armour[WC_NUM_WEAPON_CLASSES];
UDWORD numWeaps; ///< Watermelon:Re-enabled this,I need this one in droid.c
WEAPON asWeaps[DROID_MAXWEAPS];
// The group the droid belongs to

0 comments on commit a1cb2af

Please sign in to comment.