mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
various fixes for #828
This commit is contained in:
parent
12e71e0dff
commit
17a513c01b
@ -328,8 +328,9 @@ DLL_LINKAGE std::string MetaString::buildList () const
|
|||||||
|
|
||||||
void MetaString::addCreReplacement(TCreature id, TQuantity count) //adds sing or plural name;
|
void MetaString::addCreReplacement(TCreature id, TQuantity count) //adds sing or plural name;
|
||||||
{
|
{
|
||||||
assert(count);
|
if (!count)
|
||||||
if (count == 1)
|
addReplacement (CRE_PL_NAMES, id); //no creatures - just empty name (eg. defeat Angels)
|
||||||
|
else if (count == 1)
|
||||||
addReplacement (CRE_SING_NAMES, id);
|
addReplacement (CRE_SING_NAMES, id);
|
||||||
else
|
else
|
||||||
addReplacement (CRE_PL_NAMES, id);
|
addReplacement (CRE_PL_NAMES, id);
|
||||||
@ -337,7 +338,6 @@ void MetaString::addCreReplacement(TCreature id, TQuantity count) //adds sing o
|
|||||||
|
|
||||||
void MetaString::addReplacement(const CStackBasicDescriptor &stack)
|
void MetaString::addReplacement(const CStackBasicDescriptor &stack)
|
||||||
{
|
{
|
||||||
assert(stack.count); //valid count
|
|
||||||
assert(stack.type); //valid type
|
assert(stack.type); //valid type
|
||||||
addCreReplacement(stack.type->idNumber, stack.count);
|
addCreReplacement(stack.type->idNumber, stack.count);
|
||||||
}
|
}
|
||||||
|
@ -4404,7 +4404,7 @@ void CGSeerHut::setObjToKill()
|
|||||||
if (missionType == MISSION_KILL_CREATURE)
|
if (missionType == MISSION_KILL_CREATURE)
|
||||||
{
|
{
|
||||||
stackToKill = getCreatureToKill(false)->getStack(0); //FIXME: stacks tend to dissapear (desync?) on server :?
|
stackToKill = getCreatureToKill(false)->getStack(0); //FIXME: stacks tend to dissapear (desync?) on server :?
|
||||||
assert (stackToKill.count > 0); //seemingly creatures are uninitialized
|
stackToKill.count = 0; //no count in info window
|
||||||
stackDirection = checkDirection();
|
stackDirection = checkDirection();
|
||||||
}
|
}
|
||||||
else if (missionType == MISSION_KILL_HERO)
|
else if (missionType == MISSION_KILL_HERO)
|
||||||
@ -4445,8 +4445,13 @@ const std::string & CGSeerHut::getHoverText() const
|
|||||||
switch (ID)
|
switch (ID)
|
||||||
{
|
{
|
||||||
case 83:
|
case 83:
|
||||||
|
if (progress)
|
||||||
|
{
|
||||||
hoverName = VLC->generaltexth->allTexts[347];
|
hoverName = VLC->generaltexth->allTexts[347];
|
||||||
boost::algorithm::replace_first(hoverName,"%s", seerName);
|
boost::algorithm::replace_first(hoverName,"%s", seerName);
|
||||||
|
}
|
||||||
|
else //just seer hut
|
||||||
|
hoverName = VLC->generaltexth->names[ID];
|
||||||
break;
|
break;
|
||||||
case 215:
|
case 215:
|
||||||
hoverName = VLC->generaltexth->names[ID];
|
hoverName = VLC->generaltexth->names[ID];
|
||||||
@ -4522,7 +4527,7 @@ void CGSeerHut::setPropertyDer (ui8 what, ui32 val)
|
|||||||
}
|
}
|
||||||
void CGSeerHut::newTurn() const
|
void CGSeerHut::newTurn() const
|
||||||
{
|
{
|
||||||
if (lastDay >= 0 && lastDay <= cb->getDate(0)) //time is up
|
if (lastDay >= 0 && lastDay < cb->getDate(0)) //time is up
|
||||||
{
|
{
|
||||||
cb->setObjProperty (id, 11, 0);
|
cb->setObjProperty (id, 11, 0);
|
||||||
cb->setObjProperty (id, 10, 0);
|
cb->setObjProperty (id, 10, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user