FIX: The end of item cheating
This commit is contained in:
@@ -357,3 +357,12 @@ bool Inventory::removeItem( const ItemInstance* samePtr ) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Inventory::print() {
|
||||
LOGI("%s's Inventory:\n", player->name.c_str());
|
||||
|
||||
for (int i = 0; i < numTotalSlots; i++) {
|
||||
auto item = getItem(i);
|
||||
if (item) LOGI("\t %i: %s (%i) %s\n", i, item->getName().c_str(), item->count, (player->inventory->getLinked(i))? "(Linked)" : "");
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
int getAttackDamage(Entity* entity);
|
||||
float getDestroySpeed(Tile* tile);
|
||||
bool canDestroy(Tile* tile);
|
||||
|
||||
void print();
|
||||
private:
|
||||
void setupDefault();
|
||||
public:
|
||||
|
||||
@@ -290,3 +290,7 @@ bool ItemInstance::isArmorItem( const ItemInstance* instance ) {
|
||||
|
||||
return item->isArmor();
|
||||
}
|
||||
|
||||
bool ItemInstance::isBlock(const ItemInstance* instance) {
|
||||
return instance->id < 256;
|
||||
}
|
||||
@@ -81,6 +81,8 @@ public:
|
||||
|
||||
static bool isArmorItem(const ItemInstance* instance);
|
||||
|
||||
static bool isBlock(const ItemInstance* instance);
|
||||
|
||||
/**
|
||||
* Checks if this item is the same item as the other one, disregarding the
|
||||
* 'count' value.
|
||||
|
||||
Reference in New Issue
Block a user