Ok, I have this function:
In item.cpp and this in item.h:
I compile my engine, it displays an error:
PHP:
std::string Item::getWeightDescription(const Item* item/* = NULL*/, double weight, bool stackable, uint32_t count/* = 1*/)
{
if(item && weight > 0)
{
std::stringstream s;
if(stackable && count > 1)
s << "They weigh " << std::fixed << std::setprecision(2) << weight << " oz.";
else
s << "It weighs " << std::fixed << std::setprecision(2) << weight << " oz.";
return s.str();
}
return "";
}
PHP:
static std::string getWeightDescription(const Item* item = NULL, double weight, bool stackable, uint32_t count = 1);
std::string getWeightDescription() const {return getWeightDescription(this, getWeight(), items[id].stackable, count);}
PHP:
1520 C:\Users\Oskar\Desktop\0.3.6pl1.r83\item.cpp default argument missing for parameter 2 of `static std::string Item::getWeightDescription(const Item*, double, bool, uint32_t)'