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.
This commit is contained in:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -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))
{