Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gameclient): one production cameo per queue entry, not per unit

Olcay Seyganf4cfc56fa29e
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index c3d7c1de4..bd54035ea 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -5548,19 +5548,11 @@ static void appendProducerQueue( Object *obj, InGameUI::ProductionStripSlot *slo
for( const ProductionEntry *p = pu->firstProduction(); p; p = pu->nextProduction( p ) )
{
- Int repeat = 1;
Int id = 0;
Bool isUpgrade = FALSE;
if( p->getProductionType() == PRODUCTION_UNIT )
{
- //
- // an entry can stand for several units of the same kind, and each of them is its own
- // cameo here - the strip counts units, not orders
- //
- repeat = p->getProductionQuantityRemaining();
- if( repeat < 1 )
- repeat = 1;
id = (Int)p->getProductionID();
}
else if( p->getProductionType() == PRODUCTION_UPGRADE && p->getProductionUpgrade() )
@@ -5571,20 +5563,25 @@ static void appendProducerQueue( Object *obj, InGameUI::ProductionStripSlot *slo
else
continue;
- while( repeat-- > 0 )
- {
- (*total)++;
+ //
+ // one cameo per queue entry, not per unit that entry will deliver. A quantity modifier
+ // (ProductionUpdate's QuantityModifier - the China barracks builds Red Guards in pairs)
+ // makes one order hand back several units, but it is still one order: it was paid for
+ // once, the command bar's count badge counts it once, and one cancel takes all of it
+ // away. Drawing it as several cameos said the player had queued more than they had, and
+ // promised a cancel per cameo that does not exist.
+ //
+ (*total)++;
- if( *count >= max )
- continue; // past the end of the row: counted, but not drawn
+ if( *count >= max )
+ continue; // past the end of the row: counted, but not drawn
- InGameUI::ProductionStripSlot *slot = &slots[ (*count)++ ];
- slot->producer = obj->getID();
- slot->id = id;
- slot->isUpgrade = isUpgrade;
- slot->pos.x = 0;
- slot->pos.y = 0;
- }
+ InGameUI::ProductionStripSlot *slot = &slots[ (*count)++ ];
+ slot->producer = obj->getID();
+ slot->id = id;
+ slot->isUpgrade = isUpgrade;
+ slot->pos.x = 0;
+ slot->pos.y = 0;
}
}