mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +00:00
Bugfixes
* Groups can now be abandoned using the "leave group" button. * Non-group passive powers no longer buff the group leader instead of buffing the summoner. * Adjusted various warning causing code pieces. * Adjusted potions and battery prices.
This commit is contained in:
parent
6e3d0868cb
commit
7caa73caca
@ -7,7 +7,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// windows
|
// windows
|
||||||
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
|
#endif
|
||||||
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -147,9 +147,6 @@ void GroupManager::joinGroup(CNSocket* sock, CNPacketData* data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GroupManager::leaveGroup(CNSocket* sock, CNPacketData* data) {
|
void GroupManager::leaveGroup(CNSocket* sock, CNPacketData* data) {
|
||||||
if (data->size != sizeof(P_CL2FE_REQ_PC_GROUP_LEAVE))
|
|
||||||
return; // malformed packet
|
|
||||||
|
|
||||||
Player* plr = PlayerManager::getPlayer(sock);
|
Player* plr = PlayerManager::getPlayer(sock);
|
||||||
|
|
||||||
if (plr == nullptr)
|
if (plr == nullptr)
|
||||||
|
@ -351,7 +351,7 @@ void NPCManager::npcVendorTable(CNSocket* sock, CNPacketData* data) {
|
|||||||
|
|
||||||
INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_TABLE_UPDATE_SUCC, resp);
|
INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_TABLE_UPDATE_SUCC, resp);
|
||||||
|
|
||||||
for (int i = 0; i < listings.size() && i < 20; i++) { // 20 is the max
|
for (int i = 0; i < (int)listings.size() && i < 20; i++) { // 20 is the max
|
||||||
sItemBase base;
|
sItemBase base;
|
||||||
base.iID = listings[i].iID;
|
base.iID = listings[i].iID;
|
||||||
base.iOpt = 0;
|
base.iOpt = 0;
|
||||||
@ -393,7 +393,7 @@ void NPCManager::npcVendorBuyBattery(CNSocket* sock, CNPacketData* data) {
|
|||||||
if (plr == nullptr)
|
if (plr == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int cost = req->Item.iOpt * 100;
|
int cost = req->Item.iOpt * 10;
|
||||||
if ((req->Item.iID == 3 ? (plr->batteryW >= 9999) : (plr->batteryN >= 9999)) || plr->money < cost) { // sanity check
|
if ((req->Item.iID == 3 ? (plr->batteryW >= 9999) : (plr->batteryN >= 9999)) || plr->money < cost) { // sanity check
|
||||||
INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_BATTERY_BUY_FAIL, failResp);
|
INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_BATTERY_BUY_FAIL, failResp);
|
||||||
failResp.iErrorCode = 0;
|
failResp.iErrorCode = 0;
|
||||||
|
@ -702,6 +702,8 @@ void NanoManager::nanoBuff(CNSocket* sock, int16_t nanoId, int skillId, int16_t
|
|||||||
|
|
||||||
if (groupPower)
|
if (groupPower)
|
||||||
pktCnt = leader->groupCnt;
|
pktCnt = leader->groupCnt;
|
||||||
|
else
|
||||||
|
leader = plr;
|
||||||
|
|
||||||
if (!validOutVarPacket(sizeof(sP_FE2CL_NANO_SKILL_USE), pktCnt, sizeof(sSkillResult_Buff))) {
|
if (!validOutVarPacket(sizeof(sP_FE2CL_NANO_SKILL_USE), pktCnt, sizeof(sSkillResult_Buff))) {
|
||||||
std::cout << "[WARN] bad sP_FE2CL_NANO_SKILL_USE packet size\n";
|
std::cout << "[WARN] bad sP_FE2CL_NANO_SKILL_USE packet size\n";
|
||||||
@ -783,6 +785,8 @@ void NanoManager::nanoUnbuff(CNSocket* sock, int32_t iCBFlag, int16_t eCharStatu
|
|||||||
|
|
||||||
if (groupPower)
|
if (groupPower)
|
||||||
pktCnt = leader->groupCnt;
|
pktCnt = leader->groupCnt;
|
||||||
|
else
|
||||||
|
leader = plr;
|
||||||
|
|
||||||
for (int i = 0; i < pktCnt; i++) {
|
for (int i = 0; i < pktCnt; i++) {
|
||||||
Player* varPlr;
|
Player* varPlr;
|
||||||
@ -813,7 +817,7 @@ void NanoManager::nanoUnbuff(CNSocket* sock, int32_t iCBFlag, int16_t eCharStatu
|
|||||||
|
|
||||||
// 0=A 1=B 2=C -1=Not found
|
// 0=A 1=B 2=C -1=Not found
|
||||||
int NanoManager::nanoStyle(int nanoId) {
|
int NanoManager::nanoStyle(int nanoId) {
|
||||||
if (nanoId < 0 || nanoId >= NanoTable.size())
|
if (nanoId < 0 || nanoId >= (int)NanoTable.size())
|
||||||
return -1;
|
return -1;
|
||||||
return NanoTable[nanoId].style;
|
return NanoTable[nanoId].style;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user