mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
make sure humans cannot cheat with multipliers
This commit is contained in:
parent
2f1ddf7776
commit
b05adbc6d5
@ -1163,15 +1163,11 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) {
|
||||
if(map->isNextTo(unit, store)) {
|
||||
|
||||
//update resources
|
||||
int resourceMultiplierIndex=game->getGameSettings()->getResourceMultiplierIndex(unit->getFaction()->getIndex());
|
||||
int resourceAmount= unit->getLoadCount();
|
||||
//printf("Faction: %d - %s has resource multiplier: %d\n",unit->getFaction()->getStartLocationIndex(),unit->getFaction()->getType()->getName().c_str(),resourceMultiplierIndex);
|
||||
|
||||
//if(unit->getFaction()->getCpuControl())
|
||||
if(resourceMultiplierIndex != 5) {
|
||||
if(unit->getFaction()->getCpuControl())
|
||||
{
|
||||
int resourceMultiplierIndex=game->getGameSettings()->getResourceMultiplierIndex(unit->getFaction()->getIndex());
|
||||
resourceAmount=(resourceAmount* (resourceMultiplierIndex +5))/10;
|
||||
|
||||
//printf("Resource Amount adjusted for Faction: %d - %s has resource multiplier: %d, original vs new amount: %d --> %d\n",unit->getFaction()->getStartLocationIndex(),unit->getFaction()->getType()->getName().c_str(),resourceMultiplierIndex,unit->getLoadCount(),resourceAmount);
|
||||
}
|
||||
unit->getFaction()->incResourceAmount(unit->getLoadType(), resourceAmount);
|
||||
world->getStats()->harvest(unit->getFactionIndex(), resourceAmount);
|
||||
|
Loading…
x
Reference in New Issue
Block a user