View Issue Details

IDProjectCategoryView StatusLast Update
0000566Spring engineGeneralpublic2007-08-09 19:48
ReporterKDR_11k Assigned Toimbaczek  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000566: [PATCH]Builders don't properly check for the resources they use
DescriptionCUnit::AddBuildPower only checks if enough current metal and energy is present before giving the go ahead to add the build power but the functions used to deduct the resources (CTeam::UseEnergy, CTeam::UseMetal) use a different formula to check if they can deduct, namely:

amount < resource - 10*previousResourceUpkeep (replace "Resource" with the proper resource)

So if

resource - 10*previousResourceUpkeep < amount < resource

the construction will add the build power but the game will not deduct the resources as CTeam::UseEnergy/UseMetal assume there's not enough around.

This patch makes CUnit::AddBuildPower check if CTeam::UseEnergy and UseMetal returned true and not add to the build progress if not. It will also refund the metal that UseMetal deducted if it returned true but UseEnergy didn't.
TagsNo tags attached.
Attached Files
noMoreFreeLunch.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

imbaczek

2007-08-09 19:48

reporter   ~0001060

committed in r4169.

Issue History

Date Modified Username Field Change
2007-07-22 15:03 KDR_11k New Issue
2007-07-22 15:03 KDR_11k File Added: noMoreFreeLunch.patch
2007-08-09 19:48 imbaczek Status new => resolved
2007-08-09 19:48 imbaczek Resolution open => fixed
2007-08-09 19:48 imbaczek Assigned To => imbaczek
2007-08-09 19:48 imbaczek Note Added: 0001060