Special Storage Unbugged

  • Autor subiect Ionut
  • Dată creare
  • Răspunsuri: Răspunsuri 91
  • Vizualizări: Vizualizări 9K
imi da aceasta erroare
input_main.cpp: In member function 'int CInputMain::Shop(CHARACTER*, const char*, size_t)':
input_main.cpp:1121: error: 'class CShopManager' has no member named 'Buy'

la linia asta

int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
{
TPacketCGShop * p = (TPacketCGShop *) data;

if (uiBytes < sizeof(TPacketCGShop))
return -1;

if (test_server)
sys_log(0, "CInputMain::Shop() ==> SubHeader %d", p->subheader);

const char * c_pData = data + sizeof(TPacketCGShop);
uiBytes -= sizeof(TPacketCGShop);

switch (p->subheader)
{
case SHOP_SUBHEADER_CG_END:
sys_log(1, "INPUT: %s SHOP: END", ch->GetName());
CShopManager::instance().StopShopping(ch);
return 0;

case SHOP_SUBHEADER_CG_BUY:
{
if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
return -1;

BYTE bPos = *(c_pData + 1);
sys_log(1, "INPUT: %s SHOP: BUY %d", ch->GetName(), bPos);
CShopManager::instance().Buy(ch, bPos);
return (sizeof(BYTE) + sizeof(BYTE));
}

case SHOP_SUBHEADER_CG_SELL:
{
if (uiBytes < sizeof(BYTE))
return -1;

BYTE pos = *c_pData;

sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());
CShopManager::instance().Sell(ch, pos);
return sizeof(BYTE);
}
#ifdef ENABLE_SPECIAL_STORAGE
case SHOP_SUBHEADER_CG_SELL2:
{
if (uiBytes < sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE))
return -1;

const BYTE wPos = *reinterpret_cast<const BYTE*>(c_pData);
const BYTE bCount = *(c_pData + sizeof(BYTE));
const BYTE bType = *(c_pData + sizeof(BYTE) + sizeof(BYTE));

sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());

CShopManager::instance().Sell(ch, wPos, bCount, bType);
return sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE);
}
#else
case SHOP_SUBHEADER_CG_SELL2:
{
if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
return -1;

BYTE pos = *(c_pData++);
BYTE count = *(c_pData);

sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, pos, count);
return sizeof(BYTE) + sizeof(BYTE);
}
#endif
default:
sys_err("CInputMain::Shop : Unknown subheader %d : %s", p->subheader, ch->GetName());
break;
}

return 0;
}