Hey everyone, i've been browsing for a fix to my problem
1>c:\documents and settings\user\desktop\judis_repack\judis repack\judis repack\maplestoryserver\inventory.cpp(386) : error C2065: 'amount' : undeclared identifier
I've found some solutions but I'm not sure how they pertain to my problem. If possible, would there be any general methods of resolving such undeclared identifier problems? This is the string, I'm a complete beginner so i'm really bad a this. Thanks
void Inventory::takeItem(Player* player, int item, int howmany){
for(int i=0; i<player->inv->getItemNum(); i++)
if(player->inv->getItem(i)->id == item){
if(player->inv->getItem(i)->amount>=howmany){
Item* item = player->inv->getItem(i);
item->amount-=howmany;
howmany=0;
if (ISSTAR(item->id)) amount = item->amount;
if(item->amount == 0){
InventoryPacket::moveItem(player, item->inv, item->pos, 0);
player->inv->deleteItem(i);
}
else
InventoryPacket::moveItemS(player, item->inv, item->pos, item->amount);
break;
}
else{
Item* item = player->inv->getItem(i);
howmany-=item->amount;
item->amount=0;
InventoryPacket::moveItem(player, item->inv, item->pos, 0);
player->inv->deleteItem(i);
}
}
}