Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Rename 'power' for rearm pad repair points to 'repairPoints', we do…
… not need to carry over the weird naming scheme of our ancestors

* Make repairPoints uint32_t throughout its usage
  • Loading branch information
kreuvf committed Aug 3, 2014
1 parent a9d4662 commit 583903b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/functiondef.h
Expand Up @@ -125,6 +125,7 @@ struct RESEARCH_FUNCTION : public FUNCTION
/*To rearm VTOLs*/
struct REARM_FUNCTION : public FUNCTION
{
uint32_t repairPoints; /*The number of repair points added per cycle*/
UDWORD reArmPoints; /*The number of reArm points added per cycle*/
};

Expand Down
4 changes: 2 additions & 2 deletions src/structure.cpp
Expand Up @@ -3414,7 +3414,7 @@ static void aiUpdateStructure(STRUCTURE *psStructure, bool isMission)
UDWORD pointsAlreadyAdded;

//Tentatively hardcoded value
psReArmPad->power = 100;
psReArmPad->repairPoints = 100;

psDroid = (DROID *)psChosenObj;
ASSERT_OR_RETURN( , psDroid != NULL, "invalid droid pointer");
Expand Down Expand Up @@ -3513,7 +3513,7 @@ static void aiUpdateStructure(STRUCTURE *psStructure, bool isMission)

// FIXME: duplicate code, make repairing cost power again
/* do repairing */
psDroid->body += gameTimeAdjustedAverage(psReArmPad->power);
psDroid->body += gameTimeAdjustedAverage(psReArmPad->repairPoints);

if (psDroid->body >= psDroid->originalBody)
{
Expand Down
2 changes: 1 addition & 1 deletion src/structuredef.h
Expand Up @@ -222,7 +222,7 @@ struct REPAIR_FACILITY

struct REARM_PAD
{
UDWORD power; // Repair rate. Nothing to do with power.
uint32_t repairPoints; /* repair points per cycle */
UDWORD reArmPoints; /* rearm points per cycle */
UDWORD timeStarted; /* Time reArm started on current object */
BASE_OBJECT *psObj; /* Object being rearmed */
Expand Down

0 comments on commit 583903b

Please sign in to comment.