Merhabalar hocalarım k envanter sistemini eklemeye çalışıyorum filesime ama char_item.cpp dosyamda dragon soula dair hiçbirşey yok arat bul yaparken dragon soula dair birşey bulamıyorum yardımcı olur musunuz
Senin için ekleme yaptım. Gözümden kaçan bir yer olabilir.
Atıp build almayı deneyip sonuçları paylaşır mısın?
compiling char_resist.cpp
char_item.cpp:1022:37: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *')
cell = GetEmptySkillBookInventory(item);
^~~~
./char.h:1271:42: note: passing argument to parameter 'size' here
int GetEmptySkillBookInventory(BYTE size) const;
^
char_item.cpp:1024:40: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *')
cell = GetEmptyUpgradeItemsInventory(item);
^~~~
./char.h:1272:45: note: passing argument to parameter 'size' here
int GetEmptyUpgradeItemsInventory(BYTE size) const;
^
char_item.cpp:1026:33: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *')
cell = GetEmptyStoneInventory(item);
^~~~
./char.h:1273:38: note: passing argument to parameter 'size' here
int GetEmptyStoneInventory(BYTE size) const;
^
char_item.cpp:1028:31: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *')
cell = GetEmptyBoxInventory(item);
^~~~
./char.h:1274:36: note: passing argument to parameter 'size' here
int GetEmptyBoxInventory(BYTE size) const;
^
char_item.cpp:1030:33: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *')
cell = GetEmptyEfsunInventory(item);
^~~~
./char.h:1275:38: note: passing argument to parameter 'size' here
int GetEmptyEfsunInventory(BYTE size) const;
^
char_item.cpp:1032:33: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *')
cell = GetEmptyCicekInventory(item);
^~~~
./char.h:1276:38: note: passing argument to parameter 'size' here
int GetEmptyCicekInventory(BYTE size) const;
^
6 errors generated.
gmake[1]: *** [Makefile:180: .obj/char_item.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory '/home/gdb_server_source/Srcs/Server/game/src'
gmake: *** [Makefile:116: all] Error 2
Kod:compiling char_resist.cpp char_item.cpp:1022:37: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *') cell = GetEmptySkillBookInventory(item); ^~~~ ./char.h:1271:42: note: passing argument to parameter 'size' here int GetEmptySkillBookInventory(BYTE size) const; ^ char_item.cpp:1024:40: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *') cell = GetEmptyUpgradeItemsInventory(item); ^~~~ ./char.h:1272:45: note: passing argument to parameter 'size' here int GetEmptyUpgradeItemsInventory(BYTE size) const; ^ char_item.cpp:1026:33: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *') cell = GetEmptyStoneInventory(item); ^~~~ ./char.h:1273:38: note: passing argument to parameter 'size' here int GetEmptyStoneInventory(BYTE size) const; ^ char_item.cpp:1028:31: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *') cell = GetEmptyBoxInventory(item); ^~~~ ./char.h:1274:36: note: passing argument to parameter 'size' here int GetEmptyBoxInventory(BYTE size) const; ^ char_item.cpp:1030:33: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *') cell = GetEmptyEfsunInventory(item); ^~~~ ./char.h:1275:38: note: passing argument to parameter 'size' here int GetEmptyEfsunInventory(BYTE size) const; ^ char_item.cpp:1032:33: error: cannot initialize a parameter of type 'BYTE' (aka 'unsigned char') with an lvalue of type 'LPITEM' (aka 'CItem *') cell = GetEmptyCicekInventory(item); ^~~~ ./char.h:1276:38: note: passing argument to parameter 'size' here int GetEmptyCicekInventory(BYTE size) const; ^ 6 errors generated. gmake[1]: *** [Makefile:180: .obj/char_item.o] Error 1 gmake[1]: *** Waiting for unfinished jobs.... gmake[1]: Leaving directory '/home/gdb_server_source/Srcs/Server/game/src' gmake: *** [Makefile:116: all] Error 2
int CHARACTER::GetEmptyInventoryEx(LPITEM item)
{
if (!item)
return -1;
int cell = -1;
if (item->IsDragonSoul())
cell = GetEmptyDragonSoulInventory(item);
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
if (item->IsSkillBook())
cell = GetEmptySkillBookInventory(item->GetSize());
if (item->IsUpgradeItem())
cell = GetEmptyUpgradeItemsInventory(item->GetSize());
if (item->IsStone())
cell = GetEmptyStoneInventory(item->GetSize());
if (item->IsBox())
cell = GetEmptyBoxInventory(item->GetSize());
if (item->IsEfsun())
cell = GetEmptyEfsunInventory(item->GetSize());
if (item->IsCicek())
cell = GetEmptyCicekInventory(item->GetSize());
#endif
else
cell = GetEmptyInventory(item->GetSize());
return cell;
}
