-
-
Save wode490390/c3916fe4070cf7f3326b2751ee6b635a to your computer and use it in GitHub Desktop.
AnvilContainerManagerController::_updateResultPreview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int __fastcall AnvilContainerManagerController::_updateResultPreview(AnvilContainerManagerController *this) | |
{ | |
AnvilContainerManagerController *v1_this; // r4 | |
unsigned __int8 *v2_materialItemStack0; // r6 | |
signed int v3; // r4 | |
int v4_isChemistryStick; // r5 | |
ItemStack *v5_enchantingBookMaterial; // r8 | |
int v6_inputBaseRepairCost; // r4 | |
int v7_materialBaseRepairCost; // r0 | |
int v8; // r0 | |
int v9_baseRepairCost; // r11 | |
unsigned int i; // r6 | |
ComponentItem *v11_inputComponentItem; // r0 | |
RepairableItemComponent *v12_inputRepairableItem; // r4 | |
int v13_repairCost; // r9 | |
int v14_inputItem; // r4 | |
int v15_materialItem; // r6 | |
signed int v16_repairCostMultiplier; // r5 | |
ComponentItem *v17_outputComponentItem; // r0 | |
DamageableItemComponent *v18_outputDamageableItem; // r0 | |
int v19_outputItemMaxDamage; // r6 | |
int v20_outputItemDamage; // r4 | |
int v21; // r6 | |
int v22_outputItemDamage; // r0 | |
int v23_outputItemNewDamage; // r0 | |
int v24_combineEnchantedItemCost; // r0 | |
int v25_cost; // r8 | |
int v26_enchCost; // r4 | |
signed int v27_success; // r6 | |
Actor *v28_player; // r0 | |
Level *v29_level; // r0 | |
int v30_recipes; // r0 | |
_DWORD *v31; // r9 | |
_DWORD *j; // r11 | |
int v33; // r6 | |
_QWORD *v34; // r0 | |
_QWORD *v35; // r0 | |
_QWORD *v36; // r0 | |
Actor *v37_player; // r0 | |
int v38_level; // r0 | |
__int64 v39; // kr08_8 | |
_QWORD *v40; // r0 | |
int v41_outputItem; // r0 | |
signed int v42_inputItemDamage; // r5 | |
unsigned int v43_inputItemMaxDamage; // r0 | |
int v44; // r0 | |
__int16 v45_inputItemNewDamage; // r0 | |
unsigned int v46_inputItemNewMaxDamage; // r0 | |
int v47; // r0 | |
int v48_inputItemMaxDamage; // r9 | |
int v49_inputItemDamage; // r10 | |
int v50_materialItemMaxDamage; // ST30_4 | |
int v51_materialItemDamage; // r4 | |
int v52_outputItemMaxDamage; // r5 | |
int v53_outputItemMaxDamage; // r6 | |
int v54; // r5 | |
int v55_outputItemDamage; // r0 | |
int v56; // r1 | |
int v57_outputItemNewDamage; // r1 | |
signed int v58_combineDamageableItemCost; // r5 | |
_QWORD *v59; // r0 | |
int v60; // r0 | |
_QWORD *v61; // r0 | |
_QWORD *v62; // r0 | |
int v63_outputItem; // r4 | |
int v64; // r0 | |
int v65_combineEnchantedItemCost; // r4 | |
signed int v66_inputItemHasCustomHoverName; // r5 | |
int v67; // r4 | |
int v68_nextRepairCost; // r6 | |
int v69; // r0 | |
int result; // r0 | |
int v71; // r0 | |
int v72; // r0 | |
bool v73_false; // [sp+0h] [bp-200h] | |
char *v74; // [sp+10h] [bp-1F0h] | |
char *v75_baseRepairCost0; // [sp+10h] [bp-1F0h] | |
ItemStackBase *v76_inputItemStack0; // [sp+28h] [bp-1D8h] | |
ItemStackBase *v77_this; // [sp+2Ch] [bp-1D4h] | |
unsigned __int8 *v78_materialItemStack; // [sp+34h] [bp-1CCh] | |
__int64 v79; // [sp+38h] [bp-1C8h] | |
int v80; // [sp+40h] [bp-1C0h] | |
int v81; // [sp+44h] [bp-1BCh] | |
int v82_0; // [sp+48h] [bp-1B8h] | |
char v83; // [sp+4Ch] [bp-1B4h] | |
ContainerManagerModel *v84_containerManagerModel; // [sp+58h] [bp-1A8h] | |
char v85_outputItemStack; // [sp+60h] [bp-1A0h] | |
unsigned __int8 v86_0; // [sp+72h] [bp-18Eh] | |
char v87outputItemStackCloneClone; // [sp+B8h] [bp-148h] | |
void **v88_outputItemStackClone; // [sp+110h] [bp-F0h] | |
__int64 *v89; // [sp+114h] [bp-ECh] | |
void ***v90_outputItemStackClone0; // [sp+120h] [bp-E0h] | |
char v91_materialItemStack[112]; // [sp+170h] [bp-90h] | |
int v92; // [sp+1E0h] [bp-20h] | |
v1_this = this; | |
j_std::__ndk1::weak_ptr<AnvilContainerManagerModel>::lock(&v84_containerManagerModel, (char *)this + 60); | |
if ( !v84_containerManagerModel ) | |
j_DebugUtils::handleAssert( | |
(DebugUtils *)"Container manager lifetime is managed by controller creation and destruction", | |
"containerModel", | |
0, | |
0, | |
1, | |
168, | |
(int)"../../handheld/src-vanilla/vanilla_shared/src/common/world/containers/managers/controllers/AnvilContainerMana" | |
"gerController.cpp", | |
"_updateResultPreview", | |
v74); | |
v76_inputItemStack0 = (ItemStackBase *)j_ContainerManagerController::_getItem0(v1_this, 0); | |
v2_materialItemStack0 = (unsigned __int8 *)j_ContainerManagerController::_getItem0(v1_this, 1); | |
v77_this = v1_this; | |
*((_DWORD *)v1_this + 18) = 0; // this.repairCost = 0 | |
if ( !j_ItemStackBase::operator bool(v76_inputItemStack0) ) | |
{ | |
*((_DWORD *)v1_this + 17) = 0; // this.finalCost = 0 | |
sub_618BE14((char *)v1_this + 76); | |
sub_618BE14((char *)v1_this + 88); | |
v91_materialItemStack[0] = 2; | |
v8 = j_std::__ndk1::unordered_map<ContainerEnumName,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,ContainerEnumNameHasher,std::__ndk1::equal_to<ContainerEnumName>,std::__ndk1::allocator<std::__ndk1::pair<ContainerEnumName const,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>>>::operator[]( | |
&ContainerCollectionNameMap, | |
v91_materialItemStack); | |
j_ContainerManagerController::_updatePreviewItem(v1_this, (char *)v1_this + 128, &ItemInstance::EMPTY_ITEM, v8); | |
goto LABEL_115; | |
} | |
j_ItemInstance::ItemInstance((ItemInstance *)&v85_outputItemStack, v76_inputItemStack0); | |
j_HashedString::HashedString((HashedString *)v91_materialItemStack, (const HashedString *)&unk_93DC678); | |
j_HashedString::HashedString((HashedString *)&v91_materialItemStack[24], (const HashedString *)&unk_93DC510); | |
sub_61BC4F4(&v83, v91_materialItemStack, 2); | |
*((_BYTE *)v1_this + 104) = j_ItemStackBase::isOneOfInstances(v76_inputItemStack0); | |
j_std::__ndk1::__vector_base<HashedString,std::__ndk1::allocator<HashedString>>::~__vector_base(&v83); | |
v3 = 32; | |
do | |
{ | |
j_std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>::~basic_string(&v91_materialItemStack[v3]); | |
v3 -= 24; | |
} | |
while ( v3 != -16 ); | |
*((_DWORD *)v77_this + 17) = 1; // this.finalCost = 1 | |
v4_isChemistryStick = j_ChemistryStickItem::isChemistryStick((ChemistryStickItem *)v2_materialItemStack0, v77_this); | |
v78_materialItemStack = v2_materialItemStack0; | |
v5_enchantingBookMaterial = (ItemStack *)j_ItemStackBase::isEnchantingBook((ItemStackBase *)v2_materialItemStack0); | |
v6_inputBaseRepairCost = j_ItemStackBase::getBaseRepairCost(v76_inputItemStack0); | |
if ( j_ItemStackBase::isNull((ItemStackBase *)v2_materialItemStack0) ) | |
v7_materialBaseRepairCost = 0; | |
else | |
v7_materialBaseRepairCost = j_ItemStackBase::getBaseRepairCost((ItemStackBase *)v2_materialItemStack0); | |
v9_baseRepairCost = v7_materialBaseRepairCost + v6_inputBaseRepairCost; | |
if ( !*((_BYTE *)v77_this + 104) ) | |
{ | |
if ( !j_ItemStackBase::operator bool((ItemStackBase *)v2_materialItemStack0) ) | |
{ | |
v27_success = 0; | |
goto LABEL_51; | |
} | |
v11_inputComponentItem = (ComponentItem *)j_ItemStackBase::getComponentItem(v76_inputItemStack0); | |
if ( v11_inputComponentItem | |
&& (v12_inputRepairableItem = (RepairableItemComponent *)j_ComponentItem::getRepairable(v11_inputComponentItem)) != 0 ) | |
{ | |
j_ItemStack::ItemStack((ItemStack *)v91_materialItemStack, (const ItemStack *)v2_materialItemStack0); | |
v13_repairCost = j_RepairableItemComponent::handleItemRepair( | |
v12_inputRepairableItem, | |
(ItemStackBase *)v91_materialItemStack, | |
(ItemStackBase *)&v85_outputItemStack); | |
if ( !j_ItemStackBase::operator bool((ItemStackBase *)&v85_outputItemStack) ) | |
goto LABEL_116; | |
*((_DWORD *)v77_this + 18) = v13_repairCost;// this.repairCost = repairCost | |
v14_inputItem = j_ItemStackBase::getItem(v76_inputItemStack0); | |
v15_materialItem = j_ItemStackBase::getItem((ItemStackBase *)v2_materialItemStack0); | |
v16_repairCostMultiplier = 1; | |
if ( v14_inputItem == v15_materialItem ) | |
v16_repairCostMultiplier = 2; | |
v17_outputComponentItem = (ComponentItem *)j_ItemStackBase::getComponentItem((ItemStackBase *)&v85_outputItemStack); | |
v18_outputDamageableItem = (DamageableItemComponent *)j_ComponentItem::getDamageable(v17_outputComponentItem); | |
if ( v14_inputItem == v15_materialItem ) | |
{ | |
v19_outputItemMaxDamage = j_DamageableItemComponent::getMaxDamage(v18_outputDamageableItem); | |
v20_outputItemDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)&v85_outputItemStack); | |
v21 = sub_61695CC(7 * v19_outputItemMaxDamage, 100); | |
v22_outputItemDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)&v85_outputItemStack); | |
if ( v21 < v20_outputItemDamage ) | |
v20_outputItemDamage = v21; | |
v23_outputItemNewDamage = v22_outputItemDamage - v20_outputItemDamage; | |
if ( v23_outputItemNewDamage >= 1 ) | |
j_ItemStackBase::setDamageValue((ItemStackBase *)&v85_outputItemStack, v23_outputItemNewDamage); | |
} | |
j_ItemStack::ItemStack((ItemStack *)&v88_outputItemStackClone, (const ItemInstance *)&v85_outputItemStack); | |
v24_combineEnchantedItemCost = j_EnchantUtils::combineEnchantedItems( | |
v76_inputItemStack0, | |
(const ItemStack *)v78_materialItemStack, | |
(const ItemStack *)&v88_outputItemStackClone, | |
v5_enchantingBookMaterial, | |
v73_false); | |
v25_cost = v16_repairCostMultiplier * v13_repairCost; | |
v26_enchCost = v24_combineEnchantedItemCost; | |
if ( v24_combineEnchantedItemCost >= 1 ) | |
{ | |
j_ItemInstance::ItemInstance( | |
(ItemInstance *)&v87outputItemStackCloneClone, | |
(const ItemStackBase *)&v88_outputItemStackClone); | |
j_ItemInstance::operator=(&v85_outputItemStack, &v87outputItemStackCloneClone); | |
v25_cost += v26_enchCost; | |
j_ItemStackBase::~ItemStackBase((ItemStackBase *)&v87outputItemStackCloneClone); | |
} | |
j_ItemStack::~ItemStack((ItemStack *)&v88_outputItemStackClone); | |
} | |
else | |
{ | |
if ( j_ItemStackBase::operator bool((ItemStackBase *)&v85_outputItemStack) ) | |
{ | |
if ( j_ItemStackBase::isDamageableItem((ItemStackBase *)&v85_outputItemStack) ) | |
{ | |
v41_outputItem = j_ItemStackBase::getItem((ItemStackBase *)&v85_outputItemStack); | |
if ( (*(int (**)(void))(*(_DWORD *)v41_outputItem + 212))() ) | |
{ | |
v42_inputItemDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)&v85_outputItemStack); | |
v43_inputItemMaxDamage = j_ItemStackBase::getMaxDamage((ItemStackBase *)&v85_outputItemStack); | |
v44 = (signed __int16)(v43_inputItemMaxDamage + ((v43_inputItemMaxDamage >> 29) & 3)); | |
if ( v42_inputItemDamage >= v44 >> 2 ) | |
v42_inputItemDamage = v44 >> 2; | |
if ( v42_inputItemDamage < 1 ) | |
{ | |
*((_DWORD *)v77_this + 17) = 0; // this.finalCost = 0 | |
v91_materialItemStack[0] = 2; | |
v72 = j_std::__ndk1::unordered_map<ContainerEnumName,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,ContainerEnumNameHasher,std::__ndk1::equal_to<ContainerEnumName>,std::__ndk1::allocator<std::__ndk1::pair<ContainerEnumName const,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>>>::operator[]( | |
&ContainerCollectionNameMap, | |
v91_materialItemStack); | |
j_ContainerManagerController::_updatePreviewItem( | |
v77_this, | |
(char *)v77_this + 128, | |
&ItemInstance::EMPTY_ITEM, | |
v72); | |
goto LABEL_114; | |
} | |
v25_cost = 0; | |
while ( v42_inputItemDamage >= 1 && v25_cost < (unsigned int)v2_materialItemStack0[18] ) | |
{ | |
v45_inputItemNewDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)&v85_outputItemStack); | |
j_ItemStackBase::setDamageValue( | |
(ItemStackBase *)&v85_outputItemStack, | |
v45_inputItemNewDamage - v42_inputItemDamage); | |
v42_inputItemDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)&v85_outputItemStack); | |
v46_inputItemNewMaxDamage = j_ItemStackBase::getMaxDamage((ItemStackBase *)&v85_outputItemStack); | |
++v25_cost; | |
v47 = (signed __int16)(v46_inputItemNewMaxDamage + ((v46_inputItemNewMaxDamage >> 29) & 3)); | |
if ( v42_inputItemDamage >= v47 >> 2 ) | |
v42_inputItemDamage = v47 >> 2; | |
} | |
*((_DWORD *)v77_this + 18) = v25_cost;// this.repairCost = cost | |
LABEL_88: | |
v27_success = 0; | |
if ( v25_cost <= 0 ) | |
goto LABEL_52; | |
goto LABEL_89; | |
} | |
} | |
} | |
if ( !v5_enchantingBookMaterial ) | |
{ | |
v63_outputItem = j_ItemStackBase::getItem((ItemStackBase *)&v85_outputItemStack); | |
if ( v63_outputItem != j_ItemStackBase::getItem((ItemStackBase *)v2_materialItemStack0) | |
|| (j_ItemStackBase::isDamageableItem((ItemStackBase *)&v85_outputItemStack) ^ 1 | v4_isChemistryStick) == 1 ) | |
{ | |
*((_DWORD *)v77_this + 17) = 0; // this.finalCost = 0 | |
v91_materialItemStack[0] = 2; | |
v64 = j_std::__ndk1::unordered_map<ContainerEnumName,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,ContainerEnumNameHasher,std::__ndk1::equal_to<ContainerEnumName>,std::__ndk1::allocator<std::__ndk1::pair<ContainerEnumName const,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>>>::operator[]( | |
&ContainerCollectionNameMap, | |
v91_materialItemStack); | |
j_ContainerManagerController::_updatePreviewItem( | |
v77_this, | |
(char *)v77_this + 128, | |
&ItemInstance::EMPTY_ITEM, | |
v64); | |
goto LABEL_114; | |
} | |
} | |
if ( j_ItemStackBase::isDamageableItem((ItemStackBase *)&v85_outputItemStack) ^ 1 | (unsigned int)v5_enchantingBookMaterial | v4_isChemistryStick ) | |
goto LABEL_121; | |
v48_inputItemMaxDamage = j_ItemStackBase::getMaxDamage(v76_inputItemStack0); | |
v49_inputItemDamage = j_ItemStackBase::getDamageValue(v76_inputItemStack0); | |
v50_materialItemMaxDamage = j_ItemStackBase::getMaxDamage((ItemStackBase *)v2_materialItemStack0); | |
v51_materialItemDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)v2_materialItemStack0); | |
v52_outputItemMaxDamage = j_ItemStackBase::getMaxDamage((ItemStackBase *)&v85_outputItemStack); | |
v53_outputItemMaxDamage = j_ItemStackBase::getMaxDamage((ItemStackBase *)&v85_outputItemStack); | |
v54 = sub_61695CC(12 * v52_outputItemMaxDamage, -100); | |
v55_outputItemDamage = j_ItemStackBase::getDamageValue((ItemStackBase *)&v85_outputItemStack); | |
v56 = v49_inputItemDamage | |
- v48_inputItemMaxDamage | |
- v50_materialItemMaxDamage | |
+ v51_materialItemDamage | |
+ v54 | |
+ v53_outputItemMaxDamage; | |
v57_outputItemNewDamage = v56 & ~(v56 >> 31); | |
if ( v57_outputItemNewDamage >= v55_outputItemDamage ) | |
{ | |
LABEL_121: | |
v58_combineDamageableItemCost = 0; | |
} | |
else | |
{ | |
j_ItemStackBase::setDamageValue((ItemStackBase *)&v85_outputItemStack, v57_outputItemNewDamage); | |
v58_combineDamageableItemCost = 2; | |
} | |
*((_DWORD *)v77_this + 18) = v86_0; // this.repairCost = 0 | |
j_ItemStack::ItemStack((ItemStack *)v91_materialItemStack, (const ItemInstance *)&v85_outputItemStack); | |
v65_combineEnchantedItemCost = j_EnchantUtils::combineEnchantedItems( | |
v76_inputItemStack0, | |
(const ItemStack *)v78_materialItemStack, | |
(const ItemStack *)v91_materialItemStack, | |
v5_enchantingBookMaterial, | |
v73_false); | |
j_ItemInstance::ItemInstance( | |
(ItemInstance *)&v88_outputItemStackClone, | |
(const ItemStackBase *)v91_materialItemStack); | |
j_ItemInstance::operator=(&v85_outputItemStack, &v88_outputItemStackClone); | |
v25_cost = v65_combineEnchantedItemCost + v58_combineDamageableItemCost; | |
j_ItemStackBase::~ItemStackBase((ItemStackBase *)&v88_outputItemStackClone); | |
} | |
j_ItemStack::~ItemStack((ItemStack *)v91_materialItemStack); | |
goto LABEL_88; | |
} | |
j_CraftingContainer::CraftingContainer((CraftingContainer *)v91_materialItemStack, 3, 3); | |
j_CraftingContainer::setItem((CraftingContainer *)v91_materialItemStack, 4, v76_inputItemStack0); | |
if ( !j_ItemStackBase::isNull((ItemStackBase *)v2_materialItemStack0) ) | |
{ | |
if ( j_ItemStackBase::isInstance((ItemStackBase *)v2_materialItemStack0, (const HashedString *)&unk_93DD368, 0) ) | |
{ | |
for ( i = 0; i < v78_materialItemStack[18]; ++i ) | |
{ | |
j_gsl::span<char const,-1>::span<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,void>( | |
&v81, | |
&unk_93DD370); | |
j_ItemStack::ItemStack(&v88_outputItemStackClone, v81, v82_0, 1, 0, 0); | |
j_Container::addItemToFirstEmptySlot((Container *)v91_materialItemStack, (ItemStack *)&v88_outputItemStackClone); | |
j_ItemStack::~ItemStack((ItemStack *)&v88_outputItemStackClone); | |
} | |
} | |
else | |
{ | |
j_ItemStack::ItemStack((ItemStack *)&v88_outputItemStackClone, (const ItemStack *)v2_materialItemStack0); | |
j_Container::addItemToFirstEmptySlot((Container *)v91_materialItemStack, (ItemStack *)&v88_outputItemStackClone); | |
j_ItemStack::~ItemStack((ItemStack *)&v88_outputItemStackClone); | |
} | |
} | |
v80 = 0; | |
v79 = 0LL; | |
v28_player = (Actor *)j_ContainerManagerModel::getPlayer(v84_containerManagerModel); | |
v29_level = (Level *)j_Actor::getLevel(v28_player); | |
v30_recipes = j_Level::getRecipes(v29_level); | |
v75_baseRepairCost0 = (char *)v9_baseRepairCost; | |
v90_outputItemStackClone0 = &v88_outputItemStackClone; | |
v89 = &v79; | |
v88_outputItemStackClone = &off_8FB0AA0; | |
j_Recipes::forEachRecipeFor(v30_recipes, &CraftingTag::CRAFTING_TABLE); | |
sub_583C8A8(&v88_outputItemStackClone); | |
v31 = (_DWORD *)HIDWORD(v79); | |
for ( j = (_DWORD *)v79; ; ++j ) | |
{ | |
if ( v31 == j ) | |
{ | |
v27_success = 0; | |
v9_baseRepairCost = (int)v75_baseRepairCost0; | |
goto LABEL_50; | |
} | |
v33 = *j; | |
if ( (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*j + 44))(*j) ) | |
{ // map recipes | |
v34 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33); | |
if ( *v34 == MapExtendingRecipe::CraftingTableID[0] && v34[1] == MapExtendingRecipe::CraftingTableID[1] ) | |
break; | |
v35 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33); | |
if ( *v35 == __PAIR__(MapExtendingRecipe::CraftingTableID, (unsigned int)MapCloningRecipe::CraftingTableID) | |
&& v35[1] == qword_9352FC0 ) | |
{ | |
break; | |
} | |
v36 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33); | |
if ( *v36 == __PAIR__(MapExtendingRecipe::CraftingTableID, (unsigned int)MapUpgradingRecipe::CraftingTableID) | |
&& v36[1] == qword_935A140 ) | |
{ | |
break; | |
} | |
} | |
LABEL_48: | |
; | |
} | |
v37_player = (Actor *)j_ContainerManagerModel::getPlayer(v84_containerManagerModel); | |
v38_level = j_Actor::getLevel(v37_player); | |
if ( !(*(int (__fastcall **)(int, char *, int))(*(_DWORD *)v33 + 28))(v33, v91_materialItemStack, v38_level) ) | |
{ | |
if ( j_ItemStackBase::isNull((ItemStackBase *)v78_materialItemStack) ) | |
{ | |
v40 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33); | |
if ( *v40 == __PAIR__(MapExtendingRecipe::CraftingTableID, (unsigned int)MapCloningRecipe::CraftingTableID) | |
&& v40[1] == qword_9352FC0 ) | |
{ | |
*((_DWORD *)v77_this + 25) = v33; | |
} | |
} | |
goto LABEL_48; | |
} | |
v39 = *(_QWORD *)(*(int (__fastcall **)(int, char *))(*(_DWORD *)v33 + 8))(v33, v91_materialItemStack); | |
if ( HIDWORD(v39) == (_DWORD)v39 ) | |
{ | |
j_DebugUtils::handleAssert( | |
(DebugUtils *)"AnvilContainerManagerController::_updateResultPreview - discrepency between matches and assemble.", | |
"false", | |
0, | |
0, | |
1, | |
236, | |
(int)"../../handheld/src-vanilla/vanilla_shared/src/common/world/containers/managers/controllers/AnvilContainerMana" | |
"gerController.cpp", | |
"_updateResultPreview", | |
v75_baseRepairCost0); | |
goto LABEL_48; | |
} | |
j_ItemInstance::operator=(&v85_outputItemStack, v39); | |
*((_DWORD *)v77_this + 25) = v33; | |
v59 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33); | |
if ( *v59 == MapExtendingRecipe::CraftingTableID[0] && v59[1] == MapExtendingRecipe::CraftingTableID[1] ) | |
{ | |
*((_DWORD *)v77_this + 18) = 8; // this.repairCost = 8 | |
j_ItemStack::ItemStack((ItemStack *)&v88_outputItemStackClone, (const ItemInstance *)&v85_outputItemStack); | |
v60 = j_CraftingEventPacket::CraftingEventPacket((CraftingEventPacket *)&v87outputItemStackCloneClone); | |
j_std::__ndk1::vector<ItemStack,std::__ndk1::allocator<ItemStack>>::emplace_back<ItemStack&>( | |
v60 + 60, | |
&v88_outputItemStackClone); | |
j_AnvilContainerManagerModel::sendCraftedPacket(v84_containerManagerModel, (CraftingEventPacket *)&v87outputItemStackCloneClone); | |
j_AnvilContainerManagerModel::fireItemCraftedEvent(v84_containerManagerModel, (const ItemInstance *)&v85_outputItemStack); | |
j_CraftingEventPacket::~CraftingEventPacket((CraftingEventPacket *)&v87outputItemStackCloneClone); | |
j_ItemStack::~ItemStack((ItemStack *)&v88_outputItemStackClone); | |
goto LABEL_80; | |
} | |
v61 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33); | |
if ( (*v61 ^ MapCloningRecipe::CraftingTableID || v61[1] != qword_9352FC0) | |
&& ((v62 = (_QWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 36))(v33), | |
*v62 ^ MapUpgradingRecipe::CraftingTableID) | |
|| v62[1] != qword_935A140) ) | |
{ | |
LABEL_80: | |
v27_success = 1; | |
} | |
else | |
{ | |
v27_success = 1; | |
*((_DWORD *)v77_this + 18) = 1; // this.repairCost = 1 | |
} | |
v9_baseRepairCost = 0; | |
LABEL_50: | |
j_std::__ndk1::__vector_base<std::__ndk1::reference_wrapper<Recipe const>,std::__ndk1::allocator<std::__ndk1::reference_wrapper<Recipe const>>>::~__vector_base(&v79); | |
j_CraftingContainer::~CraftingContainer((CraftingContainer *)v91_materialItemStack); | |
LABEL_51: | |
v25_cost = 0; | |
LABEL_52: | |
if ( j_ItemStackBase::operator bool((ItemStackBase *)v78_materialItemStack) | |
&& (!*((_BYTE *)v77_this + 104) || !*((_DWORD *)v77_this + 25)) ) | |
{ | |
LABEL_94: | |
v66_inputItemHasCustomHoverName = 0; | |
goto LABEL_95; | |
} | |
LABEL_89: | |
if ( ItemTransferRequest::Entry::isSpecialLocation((ItemStackBase *)((char *)v77_this + 76)) ) | |
{ | |
v66_inputItemHasCustomHoverName = j_ItemStackBase::hasCustomHoverName(v76_inputItemStack0); | |
j_ItemStackBase::resetHoverName((ItemStackBase *)&v85_outputItemStack); | |
v25_cost += v66_inputItemHasCustomHoverName; | |
} | |
else | |
{ | |
if ( j_ItemStackBase::isNull(v76_inputItemStack0) ) | |
goto LABEL_94; | |
j_ItemStackBase::getName((ItemStackBase *)v91_materialItemStack); | |
v67 = sub_6183A50((char *)v77_this + 76, v91_materialItemStack); | |
j_std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>::~basic_string(v91_materialItemStack); | |
if ( !v67 ) | |
goto LABEL_94; | |
j_ItemStackBase::setCustomName(&v85_outputItemStack, (char *)v77_this + 88); | |
++v25_cost; | |
v66_inputItemHasCustomHoverName = 1; | |
} | |
LABEL_95: | |
*((_DWORD *)v77_this + 17) = v25_cost + v9_baseRepairCost;// this.finalCost = cost + baseRepairCost | |
if ( !v27_success && v25_cost <= 0 ) | |
j_ItemStackBase::setNull((ItemStackBase *)&v85_outputItemStack); | |
if ( v66_inputItemHasCustomHoverName && v66_inputItemHasCustomHoverName == v25_cost && *((_DWORD *)v77_this + 17) > 39 )// this.finalCost > 39 | |
*((_DWORD *)v77_this + 17) = 39; // this.finalCost = 39 | |
if ( j_AnvilContainerManagerController::_isTooExpensive(v77_this) ) | |
j_ItemStackBase::setNull((ItemStackBase *)&v85_outputItemStack); | |
if ( !j_ItemStackBase::isNull((ItemStackBase *)&v85_outputItemStack) ) | |
{ | |
v68_nextRepairCost = j_ItemStackBase::getBaseRepairCost((ItemStackBase *)&v85_outputItemStack); | |
if ( !j_ItemStackBase::isNull((ItemStackBase *)v78_materialItemStack) | |
&& v68_nextRepairCost < j_ItemStackBase::getBaseRepairCost((ItemStackBase *)v78_materialItemStack) ) | |
{ | |
v68_nextRepairCost = j_ItemStackBase::getBaseRepairCost((ItemStackBase *)v78_materialItemStack); | |
} | |
if ( !*((_BYTE *)v77_this + 104) | |
&& (!v66_inputItemHasCustomHoverName || v25_cost != v66_inputItemHasCustomHoverName) ) | |
{ | |
v68_nextRepairCost = 2 * v68_nextRepairCost + 1; | |
} | |
j_ItemStackBase::setRepairCost((ItemStackBase *)&v85_outputItemStack, v68_nextRepairCost); | |
} | |
v91_materialItemStack[0] = 2; | |
v69 = j_std::__ndk1::unordered_map<ContainerEnumName,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,ContainerEnumNameHasher,std::__ndk1::equal_to<ContainerEnumName>,std::__ndk1::allocator<std::__ndk1::pair<ContainerEnumName const,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>>>::operator[]( | |
&ContainerCollectionNameMap, | |
v91_materialItemStack); | |
j_ContainerManagerController::_updatePreviewItem(v77_this, (char *)v77_this + 128, &v85_outputItemStack, v69); | |
LABEL_114: | |
while ( 1 ) | |
{ | |
j_ItemStackBase::~ItemStackBase((ItemStackBase *)&v85_outputItemStack); | |
LABEL_115: | |
j_std::__ndk1::shared_ptr<AnvilContainerManagerModel>::~shared_ptr(&v84_containerManagerModel); | |
result = _stack_chk_guard - v92; | |
if ( _stack_chk_guard == v92 ) | |
break; | |
LABEL_116: | |
LOBYTE(v88_outputItemStackClone) = 2; | |
v71 = j_std::__ndk1::unordered_map<ContainerEnumName,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,ContainerEnumNameHasher,std::__ndk1::equal_to<ContainerEnumName>,std::__ndk1::allocator<std::__ndk1::pair<ContainerEnumName const,std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>>>::operator[]( | |
&ContainerCollectionNameMap, | |
&v88_outputItemStackClone); | |
j_ContainerManagerController::_updatePreviewItem(v77_this, (char *)v77_this + 128, &ItemInstance::EMPTY_ITEM, v71); | |
j_ItemStack::~ItemStack((ItemStack *)v91_materialItemStack); | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment