kennyubuntu
Member
- Joined
- May 20, 2016
- Messages
- 150
- Reaction score
- 13
I trying to use this function: Feature - Auto recharge ammo
From @Joe Rod that when you hit your last bolt,arrow... And if u have more ammo it auto recharge
I love the idea and tried to use in my source code, but its not compiling...
What i'm doing wrong?
weapons.cpp
hastebin
weapons.h
hastebin
From @Joe Rod that when you hit your last bolt,arrow... And if u have more ammo it auto recharge
I love the idea and tried to use in my source code, but its not compiling...
What i'm doing wrong?
Code:
weapons.cpp: In member function ‘virtual void Weapon::onUsedAmmo(Player*, Item*, Tile*) const’:
weapons.cpp:445:38: error: ‘class Player’ has no member named ‘getItemTypeCount’
uint32_t playerCount = player->getItemTypeCount(item->getID(), -1);
^
weapons.cpp:452:19: error: ‘class Player’ has no member named ‘removeItemOfType’
player->removeItemOfType(item->getID(), removeCount, item->getSubType
^
weapons.cpp:457:35: error: ‘MESSAGE_STATUS_SMALL’ was not declared in this scope
player->sendTextMessage(MESSAGE_STATUS_SMALL, ss.str());
^
weapons.cpp:467:8: error: jump to case label [-fpermissive]
case AMMOACTION_REMOVECHARGE:
^
weapons.cpp:442:13: note: crosses initialization of ‘uint32_t count’
uint32_t count = item->getItemCount();
^
weapons.cpp:471:8: error: jump to case label [-fpermissive]
case AMMOACTION_MOVE:
^
weapons.cpp:442:13: note: crosses initialization of ‘uint32_t count’
uint32_t count = item->getItemCount();
^
weapons.cpp:475:8: error: jump to case label [-fpermissive]
case AMMOACTION_MOVEBACK:
^
weapons.cpp:442:13: note: crosses initialization of ‘uint32_t count’
uint32_t count = item->getItemCount();
^
weapons.cpp:478:3: error: jump to case label [-fpermissive]
default:
^
weapons.cpp:442:13: note: crosses initialization of ‘uint32_t count’
uint32_t count = item->getItemCount();
^
weapons.cpp:438:8: warning: enumeration value ‘AMMOACTION_NONE’ not handled in switch [-Wswitch]
switch(ammoAction)
^
weapons.cpp:438:8: warning: enumeration value ‘AMMOACTION_REMOVECHARGE’ not handled in switch [-Wswitch]
weapons.cpp:438:8: warning: enumeration value ‘AMMOACTION_MOVE’ not handled in switch [-Wswitch]
weapons.cpp:438:8: warning: enumeration value ‘AMMOACTION_MOVEBACK’ not handled in switch [-Wswitch]
Makefile:547: recipe for target 'weapons.o' failed
make[1]: *** [weapons.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/waitlist.Tpo .deps/waitlist.Po
mv -f .deps/vocation.Tpo .deps/vocation.Po
weapons.cpp
hastebin
weapons.h
hastebin