mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods - CStackInstance::experience renamed to totalExperience and now stores total stack experience (multiplied by stack size) to reduce rounding errors - CStackInstance::totalExperience is now private with accessors methods - stack experience is now automatically reallocated on stack management - Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates BulkRebalanceStacks - Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop unclear "smart" in name - Reworked split-and-rebalance logic to correctly reallocate stack experience
This commit is contained in:
@@ -175,7 +175,7 @@ void QuestWidget::obtainData()
|
||||
{
|
||||
int index = i.getType()->getIndex();
|
||||
ui->lCreatureId->setCurrentIndex(index);
|
||||
ui->lCreatureAmount->setValue(i.count);
|
||||
ui->lCreatureAmount->setValue(i.getCount());
|
||||
onCreatureAdd(ui->lCreatures, ui->lCreatureId, ui->lCreatureAmount);
|
||||
}
|
||||
for(auto & i : quest.mission.heroes)
|
||||
@@ -489,7 +489,7 @@ void QuestDelegate::updateModelData(QAbstractItemModel * model, const QModelInde
|
||||
QStringList creaturesList;
|
||||
for(const auto & creature : quest.mission.creatures)
|
||||
{
|
||||
creaturesList += QString("%1 %2").arg(creature.count).arg(QString::fromStdString(creature.getType()->getNamePluralTranslated()));
|
||||
creaturesList += QString("%1 %2").arg(creature.getCount()).arg(QString::fromStdString(creature.getType()->getNamePluralTranslated()));
|
||||
}
|
||||
textList += QObject::tr("Creatures: %1").arg(creaturesList.join(", "));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user