1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

Fix build

This commit is contained in:
Ivan Savenko 2024-04-09 18:56:28 +03:00
parent 50e8d1fd82
commit 8aaa9e63dd
3 changed files with 7 additions and 6 deletions

View File

@ -170,10 +170,13 @@ DLL_LINKAGE std::string MetaString::toString() const
case EMessage::REPLACE_POSITIVE_NUMBER: case EMessage::REPLACE_POSITIVE_NUMBER:
if (dst.find("%+d") != std::string::npos) if (dst.find("%+d") != std::string::npos)
{ {
if (numbers[nums] > 0) int64_t value = numbers[nums];
boost::replace_first(dst, "%+d", '+' + std::to_string(numbers[nums++])); if (value > 0)
boost::replace_first(dst, "%+d", '+' + std::to_string(value));
else else
boost::replace_first(dst, "%+d", std::to_string(numbers[nums++])); boost::replace_first(dst, "%+d", std::to_string(value));
nums++;
} }
else else
boost::replace_first(dst, "%d", std::to_string(numbers[nums++])); boost::replace_first(dst, "%d", std::to_string(numbers[nums++]));

View File

@ -155,8 +155,6 @@ public:
std::string getClassNameTranslated() const; std::string getClassNameTranslated() const;
std::string getClassNameTextID() const; std::string getClassNameTextID() const;
public:
bool hasSpellbook() const; bool hasSpellbook() const;
int maxSpellLevel() const; int maxSpellLevel() const;
void addSpellToSpellbook(const SpellID & spell); void addSpellToSpellbook(const SpellID & spell);

View File

@ -143,7 +143,7 @@ int BonusProxy::getDescription(lua_State * L)
std::shared_ptr<const Bonus> object; std::shared_ptr<const Bonus> object;
if(!S.tryGet(1, object)) if(!S.tryGet(1, object))
return S.retNil(); return S.retNil();
return LuaStack::quickRetStr(L, object->description); return LuaStack::quickRetStr(L, object->description.toString());
} }
int BonusProxy::toJsonNode(lua_State * L) int BonusProxy::toJsonNode(lua_State * L)