1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Add bonus description generation for map objects

This commit is contained in:
Ivan Savenko
2024-10-25 18:36:02 +00:00
parent 8a5ac73438
commit ee59bc4e71
8 changed files with 22 additions and 15 deletions

View File

@ -378,7 +378,7 @@ void CBonusSystemNode::propagateBonus(const std::shared_ptr<Bonus> & b, const CB
? source.getUpdatedBonus(b, b->propagationUpdater)
: b;
bonuses.push_back(propagated);
logBonus->trace("#$# %s #propagated to# %s", propagated->Description(), nodeName());
logBonus->trace("#$# %s #propagated to# %s", propagated->Description(nullptr), nodeName());
}
TNodes lchildren;
@ -392,9 +392,9 @@ void CBonusSystemNode::unpropagateBonus(const std::shared_ptr<Bonus> & b)
if(b->propagator->shouldBeAttached(this))
{
if (bonuses -= b)
logBonus->trace("#$# %s #is no longer propagated to# %s", b->Description(), nodeName());
logBonus->trace("#$# %s #is no longer propagated to# %s", b->Description(nullptr), nodeName());
else
logBonus->warn("Attempt to remove #$# %s, which is not propagated to %s", b->Description(), nodeName());
logBonus->warn("Attempt to remove #$# %s, which is not propagated to %s", b->Description(nullptr), nodeName());
bonuses.remove_if([b](const auto & bonus)
{