Update AxoItemImpl.cpp

This commit is contained in:
KaDerox
2026-03-11 21:01:04 +01:00
committed by GitHub
parent a80b970955
commit 1dda1c4ee5

View File

@@ -90,6 +90,18 @@ public:
return mMiningSpeed;
return 1.0f;
}
bool canDestroySpecial(Tile* tile) override {
if (tile == nullptr) return false;
Material* mat = tile->material;
if (mIsPickaxe && (mat == Material::stone || mat == Material::metal || mat == Material::heavyMetal))
return true;
if (mIsAxe && mat == Material::wood)
return true;
if (mIsShovel && (mat == Material::dirt || mat == Material::sand))
return true;
return false;
}
};
class AxoFoodItem : public FoodItem {
@@ -158,6 +170,18 @@ public:
return mMiningSpeed;
return 1.0f;
}
bool canDestroySpecial(Tile* tile) override {
if (tile == nullptr) return false;
Material* mat = tile->material;
if (mIsPickaxe && (mat == Material::stone || mat == Material::metal || mat == Material::heavyMetal))
return true;
if (mIsAxe && mat == Material::wood)
return true;
if (mIsShovel && (mat == Material::dirt || mat == Material::sand))
return true;
return false;
}
};
bool AxoItem_CreateFromDef(const AxoItemDef& def) {