Skip to content

Instantly share code, notes, and snippets.

@leoetlino
Created December 15, 2018 20:55
Show Gist options
  • Save leoetlino/e59a9fcffb9b80ed25baada3be85a1d5 to your computer and use it in GitHub Desktop.
Save leoetlino/e59a9fcffb9b80ed25baada3be85a1d5 to your computer and use it in GitHub Desktop.
signed __int64 __fastcall AI_Query_HasPorchItemByCategory::doQuery(__int64 this)
{
Tag v2; // w1
char *v3; // x8
int v5; // w0
sead::SafeString v6; // [xsp+0h] [xbp-20h]
if ( !PauseMenuDataMgr::sInstance )
return 1LL;
v2 = Tag_Arrow;
switch ( this->category )
{
case 0:
v6.vptr = &sead::SafeString::vt;
v3 = "WeaponBow";
goto LABEL_22;
case 1:
v6.vptr = &sead::SafeString::vt;
v3 = "WeaponShield";
goto LABEL_22;
case 2:
v6.vptr = &sead::SafeString::vt;
v3 = "WeaponSpear";
goto LABEL_22;
case 3:
v6.vptr = &sead::SafeString::vt;
v3 = "WeaponSmallSword";
goto LABEL_22;
case 4:
v5 = PauseMenuDataMgr::countItemsWithTag(PauseMenuDataMgr::sInstance, Tag_Arrow, 0);
return v5 < this->count;
case 5:
v6.vptr = &sead::SafeString::vt;
v3 = "WeaponLargeSword";
goto LABEL_22;
case 6:
v2 = Tag_CookMushroom;
goto LABEL_19;
case 7:
v2 = Tag_RoastItem;
goto LABEL_19;
case 8:
v2 = Tag_CookFruit;
goto LABEL_19;
case 9:
v2 = Tag_CookOre;
goto LABEL_19;
case 0xA:
v2 = Tag_CookPlant;
goto LABEL_19;
case 0xB:
v2 = Tag_EnemyMaterial;
goto LABEL_19;
case 0xC:
v2 = Tag_CookMeat;
goto LABEL_19;
case 0xD:
v2 = Tag_CookMaterial;
goto LABEL_19;
case 0xE:
v6.vptr = &sead::SafeString::vt;
v3 = "HorseReins";
goto LABEL_22;
case 0xF:
v6.vptr = &sead::SafeString::vt;
v3 = "HorseSaddle";
LABEL_22:
v6.cstr = v3;
v5 = PauseMenuDataMgr::countItemsWithCategory(PauseMenuDataMgr::sInstance, &v6, 1);
break;
case 0x10:
LABEL_19:
v5 = PauseMenuDataMgr::countItemsWithTag(PauseMenuDataMgr::sInstance, v2, 1);
break;
default:
v5 = 0;
break;
}
return v5 < this->count;
}
signed __int64 __fastcall AI_Query_HasPouchItemByPouchCategory::doQuery(__int64 this)
{
unsigned int v2; // w1
int v4; // w0
sead::SafeString v5; // [xsp+0h] [xbp-20h]
if ( !PauseMenuDataMgr::sInstance )
return 1LL;
switch ( this->category )
{
case 0:
v2 = 0;
goto LABEL_13;
case 1:
v5.vptr = &sead::SafeString::vt;
v5.cstr = "WeaponBow";
v4 = PauseMenuDataMgr::countItemsWithCategory(PauseMenuDataMgr::sInstance, &v5, 0);
return v4 < this->count;
case 2:
v4 = PauseMenuDataMgr::countItemsWithTag(PauseMenuDataMgr::sInstance, Tag_Arrow, 0);
return v4 < this->count;
case 3:
v2 = 2;
goto LABEL_13;
case 4:
v2 = 3;
goto LABEL_13;
case 5:
v2 = 4;
goto LABEL_13;
case 6:
v2 = 5;
goto LABEL_13;
case 7:
v2 = 6;
LABEL_13:
v4 = PauseMenuDataMgr::countItemsWithPouchCategory(PauseMenuDataMgr::sInstance, v2);
break;
default:
v4 = 0;
break;
}
return v4 < this->count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment