Fix another bug in the power code, this one caused by sign errors

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10771 4a71c877-e1ca-e34f-864e-861f7616d084
master
Guangcong Luo 2010-05-04 18:22:29 +00:00 committed by Git SVN Gateway
parent 2197ffed66
commit a214297f71
1 changed files with 2 additions and 3 deletions

View File

@ -184,7 +184,7 @@ void powerCalc(BOOL on)
float updateExtractedPower(STRUCTURE *psBuilding)
{
RES_EXTRACTOR *pResExtractor;
UDWORD timeDiff;
SDWORD timeDiff;
UBYTE modifier;
float pointsToAdd,extractedPoints;
@ -200,7 +200,7 @@ float updateExtractedPower(STRUCTURE *psBuilding)
{
pResExtractor->timeLastUpdated = gameTime;
}
timeDiff = gameTime - pResExtractor->timeLastUpdated;
timeDiff = (int)gameTime - (int)pResExtractor->timeLastUpdated;
// Add modifier according to difficulty level
if (getDifficultyLevel() == DL_EASY)
{
@ -222,7 +222,6 @@ float updateExtractedPower(STRUCTURE *psBuilding)
// extractor is not in the right time zone
// we have a maximum time skip of less than a second, so this can't be caused by lag
ASSERT(false, "Oil derrick out of sync.");
pResExtractor->timeLastUpdated = gameTime;
pointsToAdd = 0;
}