mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
Fixed Quest Item Bug
This commit is contained in:
parent
0e3fac4d34
commit
2b95bc660c
@ -265,6 +265,7 @@ void MissionManager::quitTask(CNSocket* sock, int32_t taskNum, bool manual) {
|
|||||||
TaskData& task = *Tasks[taskNum];
|
TaskData& task = *Tasks[taskNum];
|
||||||
|
|
||||||
// clean up quest items
|
// clean up quest items
|
||||||
|
if (manual) {
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (task["m_iSUItem"][i] == 0 && task["m_iCSUItemID"][i] == 0)
|
if (task["m_iSUItem"][i] == 0 && task["m_iCSUItemID"][i] == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -277,8 +278,7 @@ void MissionManager::quitTask(CNSocket* sock, int32_t taskNum, bool manual) {
|
|||||||
if (plr->QInven[j].iID == task["m_iSUItem"][i] || plr->QInven[j].iID == task["m_iCSUItemID"][i] || plr->QInven[j].iID == task["m_iSTItemID"][i])
|
if (plr->QInven[j].iID == task["m_iSUItem"][i] || plr->QInven[j].iID == task["m_iCSUItemID"][i] || plr->QInven[j].iID == task["m_iSTItemID"][i])
|
||||||
memset(&plr->QInven[j], 0, sizeof(sItemBase));
|
memset(&plr->QInven[j], 0, sizeof(sItemBase));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (!manual) {
|
|
||||||
INITSTRUCT(sP_FE2CL_REP_PC_TASK_END_FAIL, failResp);
|
INITSTRUCT(sP_FE2CL_REP_PC_TASK_END_FAIL, failResp);
|
||||||
failResp.iErrorCode = 1;
|
failResp.iErrorCode = 1;
|
||||||
failResp.iTaskNum = taskNum;
|
failResp.iTaskNum = taskNum;
|
||||||
@ -308,6 +308,7 @@ int MissionManager::findQSlot(Player *plr, int id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MissionManager::dropQuestItem(CNSocket *sock, int task, int count, int id, int mobid) {
|
void MissionManager::dropQuestItem(CNSocket *sock, int task, int count, int id, int mobid) {
|
||||||
|
std::cout << "Altered item id " << id << " by " << count << " for task id " << task << std::endl;
|
||||||
const size_t resplen = sizeof(sP_FE2CL_REP_REWARD_ITEM) + sizeof(sItemReward);
|
const size_t resplen = sizeof(sP_FE2CL_REP_REWARD_ITEM) + sizeof(sItemReward);
|
||||||
assert(resplen < CN_PACKET_BUFFER_SIZE);
|
assert(resplen < CN_PACKET_BUFFER_SIZE);
|
||||||
// we know it's only one trailing struct, so we can skip full validation
|
// we know it's only one trailing struct, so we can skip full validation
|
||||||
|
Loading…
Reference in New Issue
Block a user