Skip to content

Instantly share code, notes, and snippets.

@leoetlino
Created May 20, 2021 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoetlino/3aa361ada87e83dc992212e68fdc1927 to your computer and use it in GitHub Desktop.
Save leoetlino/3aa361ada87e83dc992212e68fdc1927 to your computer and use it in GitHub Desktop.
signed __int64 __fastcall doCheckEquipItemType(void *a1, sead::SafeString *profile)
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
profile->assureTermination(profile);
profile->assureTermination(profile);
v3 = (char *)profile->cstr;
if ( v3 == "WeaponSmallSword" )
return 0LL;
for...
profile->assureTermination(profile);
profile->assureTermination(profile);
v6 = (char *)profile->cstr;
if ( v6 == "WeaponLargeSword" )
return 0LL;
for...
profile->assureTermination(profile);
profile->assureTermination(profile);
v9 = (char *)profile->cstr;
if ( v9 == "WeaponSpear" )
return 0LL;
for...
profile->assureTermination(profile);
profile->assureTermination(profile);
v12 = (char *)profile->cstr;
if ( v12 == "WeaponShield" )
return 1LL;
for...
profile->assureTermination(profile);
profile->assureTermination(profile);
v15 = (char *)profile->cstr;
if ( v15 == "WeaponBow" )
return 2LL;
for...
v22.__vftable = &sead::SafeString::vt;
v22.cstr = "Armor";
if ( sead::SafeString::findIndex(profile, &v22) != 0xFFFFFFFF )
return 3LL;
profile->assureTermination(profile);
profile->assureTermination(profile);
v19 = (char *)profile->cstr;
if ( v19 == "Bullet" )
return 5LL;
v20 = 0LL;
result = 4LL;
while ( 1 )
{
v21 = (unsigned __int8)v19[v20];
if ( v21 != (unsigned __int8)aBullet[v20] )
return 4LL;
if ( v21 == (unsigned __int8)sead::SafeString::cNullChar )
break;
if ( ++v20 >= 0x80001 )
return result;
}
return 5LL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment