int BattleSituation::getHPData(int player, int slot)
{
PokeBattle &p = this->poke(player,slot);
return p.lifePoints();
}
int callGetDataHP(const BattleSituation&situation, int id, int pokeslot)
{
return situation.getHPData(id, pokeslot);
}
QScriptValue ScriptEngine::getBattleData(int id, int pokeslot)
{
if(!loggedIn(id) || pokeslot < 1 || pokeslot > 6)
{
return myengine.undefinedValue();
}else{
return callGetDataHP(getHPData, id, pokeslot);
}
}
I'm getting passing 'const BattleSituation' as 'this' argument of 'int BattleSituation::getHPData(int, int)' discards qualifiers.