Remove AUTO_VAR macro and _toString function (#592)

This commit is contained in:
void_17
2026-03-06 02:11:18 +07:00
committed by GitHub
parent 7d6658fe5b
commit 55231bb8d3
294 changed files with 5067 additions and 5773 deletions

View File

@@ -17,26 +17,26 @@ void AddItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttrs
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_itemId);
dos->writeUTF( _toString( m_itemId ) );
dos->writeUTF( std::to_wstring( m_itemId ) );
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_quantity);
dos->writeUTF( _toString( m_quantity ) );
dos->writeUTF( std::to_wstring( m_quantity ) );
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_auxValue);
dos->writeUTF( _toString( m_auxValue ) );
dos->writeUTF( std::to_wstring( m_auxValue ) );
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_dataTag);
dos->writeUTF( _toString( m_dataTag ) );
dos->writeUTF( std::to_wstring( m_dataTag ) );
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_slot);
dos->writeUTF( _toString( m_slot ) );
dos->writeUTF( std::to_wstring( m_slot ) );
}
void AddItemRuleDefinition::getChildren(vector<GameRuleDefinition *> *children)
{
GameRuleDefinition::getChildren( children );
for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); it++)
children->push_back( *it );
for ( const auto& it : m_enchantments )
children->push_back( it );
}
GameRuleDefinition *AddItemRuleDefinition::addChild(ConsoleGameRules::EGameRuleType ruleType)
@@ -99,13 +99,13 @@ bool AddItemRuleDefinition::addItemToContainer(shared_ptr<Container> container,
bool added = false;
if(Item::items[m_itemId] != NULL)
{
int quantity = min(m_quantity, Item::items[m_itemId]->getMaxStackSize());
int quantity = std::min<int>(m_quantity, Item::items[m_itemId]->getMaxStackSize());
shared_ptr<ItemInstance> newItem = shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) );
newItem->set4JData(m_dataTag);
for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it)
for( auto& it : m_enchantments )
{
(*it)->enchantItem(newItem);
it->enchantItem(newItem);
}
if(m_slot >= 0 && m_slot < container->getContainerSize() )