diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
| commit | 7074f35e4ba831e358117842b99ee35b87f85ae5 (patch) | |
| tree | 7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/BowItem.cpp | |
| parent | d63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff) | |
shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
Diffstat (limited to 'Minecraft.World/BowItem.cpp')
| -rw-r--r-- | Minecraft.World/BowItem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/BowItem.cpp b/Minecraft.World/BowItem.cpp index ed2376b0..f0e46c88 100644 --- a/Minecraft.World/BowItem.cpp +++ b/Minecraft.World/BowItem.cpp @@ -18,7 +18,7 @@ BowItem::BowItem(int id) : Item( id ) icons = NULL; } -void BowItem::releaseUsing(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player, int durationLeft) +void BowItem::releaseUsing(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player, int durationLeft) { bool infiniteArrows = player->abilities.instabuild || EnchantmentHelper::getEnchantmentLevel(Enchantment::arrowInfinite->id, itemInstance) > 0; @@ -30,7 +30,7 @@ void BowItem::releaseUsing(shared_ptr<ItemInstance> itemInstance, Level *level, if (pow < 0.1) return; if (pow > 1) pow = 1; - shared_ptr<Arrow> arrow = shared_ptr<Arrow>( new Arrow(level, player, pow * 2.0f) ); + std::shared_ptr<Arrow> arrow = std::shared_ptr<Arrow>( new Arrow(level, player, pow * 2.0f) ); if (pow == 1) arrow->setCritArrow(true); int damageBonus = EnchantmentHelper::getEnchantmentLevel(Enchantment::arrowBonus->id, itemInstance); if (damageBonus > 0) @@ -62,22 +62,22 @@ void BowItem::releaseUsing(shared_ptr<ItemInstance> itemInstance, Level *level, } } -shared_ptr<ItemInstance> BowItem::useTimeDepleted(shared_ptr<ItemInstance> instance, Level *level, shared_ptr<Player> player) +std::shared_ptr<ItemInstance> BowItem::useTimeDepleted(std::shared_ptr<ItemInstance> instance, Level *level, std::shared_ptr<Player> player) { return instance; } -int BowItem::getUseDuration(shared_ptr<ItemInstance> itemInstance) +int BowItem::getUseDuration(std::shared_ptr<ItemInstance> itemInstance) { return 20 * 60 * 60; } -UseAnim BowItem::getUseAnimation(shared_ptr<ItemInstance> itemInstance) +UseAnim BowItem::getUseAnimation(std::shared_ptr<ItemInstance> itemInstance) { return UseAnim_bow; } -shared_ptr<ItemInstance> BowItem::use(shared_ptr<ItemInstance> instance, Level *level, shared_ptr<Player> player) +std::shared_ptr<ItemInstance> BowItem::use(std::shared_ptr<ItemInstance> instance, Level *level, std::shared_ptr<Player> player) { if (player->abilities.instabuild || player->inventory->hasResource(Item::arrow_Id)) { |
