Remove extractedPower.
parent
9c17ee746e
commit
8407715e34
|
@ -332,7 +332,7 @@ typedef struct _save_weapon
|
|||
typedef struct _savePower
|
||||
{
|
||||
uint32_t currentPower;
|
||||
uint32_t extractedPower;
|
||||
uint32_t extractedPower; // UNUSED
|
||||
} SAVE_POWER;
|
||||
|
||||
static bool serializeSavePowerData(PHYSFS_file* fileHandle, const SAVE_POWER* serializePower)
|
||||
|
@ -4752,7 +4752,6 @@ bool gameLoadV(PHYSFS_file* fileHandle, unsigned int version)
|
|||
if (gameType == GTYPE_SAVE_MIDMISSION || i == selectedPlayer)
|
||||
{
|
||||
setPower(i, powerSaved[i].currentPower);
|
||||
setExtractedPower(i, powerSaved[i].currentPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4837,7 +4836,7 @@ static bool writeGameFile(const char* fileName, SDWORD saveType)
|
|||
for (i = 0; i < MAX_PLAYERS; ++i)
|
||||
{
|
||||
saveGame.power[i].currentPower = getPower(i);
|
||||
saveGame.power[i].extractedPower = getExtractedPower(i);
|
||||
saveGame.power[i].extractedPower = 0; // UNUSED
|
||||
}
|
||||
|
||||
//camera position
|
||||
|
|
|
@ -269,7 +269,7 @@ GAMECODE gameLoop(void)
|
|||
|
||||
fireWaitingCallbacks(); //Now is the good time to fire waiting callbacks (since interpreter is off now)
|
||||
|
||||
updatePowerSystem();
|
||||
throttleEconomy();
|
||||
|
||||
for(i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
|
|
|
@ -3081,7 +3081,6 @@ void saveMissionPower(void)
|
|||
|
||||
for (inc = 0; inc < MAX_PLAYERS; inc++)
|
||||
{
|
||||
mission.asPower[inc].extractedPower = getExtractedPower(inc);
|
||||
mission.asPower[inc].currentPower = getPower(inc);
|
||||
}
|
||||
}
|
||||
|
@ -3093,7 +3092,6 @@ void adjustMissionPower(void)
|
|||
|
||||
for (inc = 0; inc < MAX_PLAYERS; inc++)
|
||||
{
|
||||
addExtractedPower(inc, mission.asPower[inc].extractedPower);
|
||||
addPower(inc, mission.asPower[inc].currentPower);
|
||||
}
|
||||
}
|
||||
|
|
26
src/power.c
26
src/power.c
|
@ -58,7 +58,6 @@ static void updateCurrentPower(POWER_GEN *psPowerGen, UDWORD player);
|
|||
/** Each Resource Extractor yields EXTRACT_POINTS per second until there are none left in the resource. */
|
||||
static float updateExtractedPower(STRUCTURE *psBuilding);
|
||||
|
||||
|
||||
//returns the relevant list based on OffWorld or OnWorld
|
||||
static STRUCTURE* powerStructList(UBYTE player);
|
||||
|
||||
|
@ -80,7 +79,6 @@ void clearPlayerPower(void)
|
|||
for (player = 0; player < MAX_PLAYERS; player++)
|
||||
{
|
||||
asPower[player].currentPower = 0;
|
||||
asPower[player].extractedPower = 0;
|
||||
asPower[player].powerProduced = 0;
|
||||
asPower[player].powerRequested = 0;
|
||||
asPower[player].economyThrottle = 1;
|
||||
|
@ -88,7 +86,7 @@ void clearPlayerPower(void)
|
|||
nextPowerSystemUpdate = 0;
|
||||
}
|
||||
|
||||
void updatePowerSystem(void)
|
||||
void throttleEconomy(void)
|
||||
{
|
||||
int player;
|
||||
float newThrottle;
|
||||
|
@ -164,14 +162,6 @@ void addPower(int player, float quantity)
|
|||
asPower[player].currentPower += quantity;
|
||||
}
|
||||
|
||||
void addExtractedPower(int player, float quantity)
|
||||
{
|
||||
ASSERT(player < MAX_PLAYERS, "addPower: Bad player (%u)", player);
|
||||
|
||||
asPower[player].extractedPower += quantity;
|
||||
}
|
||||
|
||||
|
||||
/*resets the power calc flag for all players*/
|
||||
void powerCalc(BOOL on)
|
||||
{
|
||||
|
@ -294,13 +284,6 @@ void setPower(int player, float power)
|
|||
asPower[player].currentPower = power;
|
||||
}
|
||||
|
||||
void setExtractedPower(int player, float power)
|
||||
{
|
||||
ASSERT(player < MAX_PLAYERS, "setPower: Bad player (%u)", player);
|
||||
|
||||
asPower[player].extractedPower = power;
|
||||
}
|
||||
|
||||
float getPower(int player)
|
||||
{
|
||||
ASSERT(player < MAX_PLAYERS, "setPower: Bad player (%u)", player);
|
||||
|
@ -308,13 +291,6 @@ float getPower(int player)
|
|||
return asPower[player].currentPower;
|
||||
}
|
||||
|
||||
float getExtractedPower(int player)
|
||||
{
|
||||
ASSERT(player < MAX_PLAYERS, "setPower: Bad player (%u)", player);
|
||||
|
||||
return asPower[player].extractedPower;
|
||||
}
|
||||
|
||||
/*Temp function to give all players some power when a new game has been loaded*/
|
||||
void newGameInitPower(void)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
typedef struct _player_power
|
||||
{
|
||||
float currentPower; ///< The current amount of power avaialble to the player.
|
||||
float extractedPower; ///< The power extracted but not converted.
|
||||
float powerProduced; ///< Power produced
|
||||
float powerRequested; ///< Power requested
|
||||
float economyThrottle; ///< Which percentage of the requested power is actually delivered
|
||||
|
@ -64,7 +63,6 @@ extern float requestPower(int player, float amount);
|
|||
extern int requestPowerFor(int player, float amount, int points);
|
||||
|
||||
extern void addPower(int player, float quantity);
|
||||
extern void addExtractedPower(int player, float quantity);
|
||||
|
||||
BOOL checkPower(int player, float quantity);
|
||||
void usePower(int player, float quantity);
|
||||
|
@ -74,7 +72,6 @@ extern void updatePlayerPower(UDWORD player);
|
|||
|
||||
/** Used in multiplayer to force power levels. */
|
||||
extern void setPower(int player, float power);
|
||||
extern void setExtractedPower(int player, float power);
|
||||
|
||||
/** Get the amount of power current held by the given player. */
|
||||
extern float getPower(int player);
|
||||
|
@ -103,6 +100,6 @@ extern BOOL droidUsesPower(DROID *psDroid);
|
|||
/** Flag used to check for power calculations to be done or not. */
|
||||
extern BOOL powerCalculated;
|
||||
|
||||
extern void updatePowerSystem(void);
|
||||
extern void throttleEconomy(void);
|
||||
|
||||
#endif // __INCLUDED_SRC_POWER_H__
|
||||
|
|
Loading…
Reference in New Issue