1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Replace pointer with reference in pack apply functions

This commit is contained in:
Ivan Savenko
2024-10-04 18:59:51 +00:00
parent 48fb58e7a0
commit c0f5c7c0ea
61 changed files with 369 additions and 369 deletions

View File

@@ -224,7 +224,7 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
iw.player = h->tempOwner;
iw.text.appendLocalString(EMetaText::ADVOB_TXT, 44); //{%s} \n\n The camp is deserted. Perhaps you should try next week.
iw.text.replaceName(ID);
cb->sendAndApply(&iw);
cb->sendAndApply(iw);
return;
}
@@ -324,7 +324,7 @@ void CGDwelling::newTurn(vstd::RNG & rand) const
}
if(change)
cb->sendAndApply(&sac);
cb->sendAndApply(sac);
updateGuards();
}
@@ -392,7 +392,7 @@ void CGDwelling::updateGuards() const
csc.slot = slot;
csc.count = crea->getGrowth() * 3;
csc.absoluteValue = true;
cb->sendAndApply(&csc);
cb->sendAndApply(csc);
}
else //slot is empty, create whole new stack
{
@@ -401,7 +401,7 @@ void CGDwelling::updateGuards() const
ns.slot = slot;
ns.type = crea->getId();
ns.count = crea->getGrowth() * 3;
cb->sendAndApply(&ns);
cb->sendAndApply(ns);
}
}
}
@@ -458,7 +458,7 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const
iw.text.replaceNamePlural(crid);
cb->showInfoDialog(&iw);
cb->sendAndApply(&sac);
cb->sendAndApply(sac);
cb->addToSlot(StackLocation(h, slot), crs, count);
}
}
@@ -469,7 +469,7 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 422); //There are no %s here to recruit.
iw.text.replaceNamePlural(crid);
iw.player = h->tempOwner;
cb->sendAndApply(&iw);
cb->sendAndApply(iw);
}
}
else
@@ -483,7 +483,7 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const
sac.creatures[0].first = !h->getArt(ArtifactPosition::MACH1); //ballista
sac.creatures[1].first = !h->getArt(ArtifactPosition::MACH3); //first aid tent
sac.creatures[2].first = !h->getArt(ArtifactPosition::MACH2); //ammo cart
cb->sendAndApply(&sac);
cb->sendAndApply(sac);
}
auto windowMode = (ID == Obj::CREATURE_GENERATOR1 || ID == Obj::REFUGEE_CAMP) ? EOpenWindowMode::RECRUITMENT_FIRST : EOpenWindowMode::RECRUITMENT_ALL;