mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make string to v3f parsing consistent, replace core.setting_get_pos()
by core.settings:get_pos()
(#15438)
Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
This commit is contained in:
parent
18caf3a18d
commit
e545e96d2b
17 changed files with 162 additions and 45 deletions
|
@ -295,10 +295,8 @@ std::string ItemStack::getWieldOverlay(const IItemDefManager *itemdef) const
|
|||
v3f ItemStack::getWieldScale(const IItemDefManager *itemdef) const
|
||||
{
|
||||
std::string scale = metadata.getString("wield_scale");
|
||||
if (scale.empty())
|
||||
return getDefinition(itemdef).wield_scale;
|
||||
|
||||
return str_to_v3f(scale);
|
||||
return str_to_v3f(scale).value_or(getDefinition(itemdef).wield_scale);
|
||||
}
|
||||
|
||||
ItemStack ItemStack::addItem(ItemStack newitem, IItemDefManager *itemdef)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue