I have three errors I've researched which I do not fully understand how to solve.
Excuse me if im not providing with enough information, Im lacking bits of C++ knowledge but Im trying my best and solved most errors so far.
What I need help with is pretty much on HOW to go further solving these issues. How to declare properly, how to access or change private members to public and how to set isRewardCorpse a member of container.
Engine im using:
TFS 1.4
The code I used as base:
Reward System [remake of #1628] by cezarguimaraes · Pull Request #1641 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/1641/files)
First one is:
Secondary:
Third one:
Excuse me if im not providing with enough information, Im lacking bits of C++ knowledge but Im trying my best and solved most errors so far.
What I need help with is pretty much on HOW to go further solving these issues. How to declare properly, how to access or change private members to public and how to set isRewardCorpse a member of container.
Engine im using:
TFS 1.4
The code I used as base:
Reward System [remake of #1628] by cezarguimaraes · Pull Request #1641 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/1641/files)
First one is:
Related to this code:Error C2065 'query': undeclared identifier theforgottenserver C:\GameFatev2 -vc14\src\iologindata.cpp 452
C++:
query.str(std::string());
query << "SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_rewards` WHERE `player_id` = " << player->getGUID() << " ORDER BY `sid` DESC";
if ((result = db.storeQuery(query.str()))) {
loadItems(itemMap, result);
Secondary:
Related to this code:Error C2248 'Container::unlocked': cannot access private member declared in class 'Container' theforgottenserver C:\GameFatev2 -vc14\src\reward.cpp 10
C++:
#include "otpch.h"
#include <iostream>
#include "reward.h"
Reward::Reward() :
Container(ITEM_REWARD_CONTAINER)
{
maxSize = 32;
unlocked = false;
pagination = true;
}
Third one:
Le code:Error C2039 'isRewardCorpse': is not a member of 'Container' theforgottenserver C:\GameFatev2 -vc14\src\actions.cpp 401
C++:
uint32_t corpseOwner = container->getCorpseOwner();
if (container->isRewardCorpse()) {
//only players who participated in the fight can open the corpse
if (!player->getReward(container->getIntAttr(ITEM_ATTRIBUTE_DATE), false)) {
return RETURNVALUE_YOUARENOTTHEOWNER;
}
} else if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
return RETURNVALUE_YOUARENOTTHEOWNER;
}