Merge pull request #547 from hellomykami/add-filter-for-auto-challenge

add item for auto challenge in sumeru
This commit is contained in:
Taiga 2022-08-27 16:00:46 -06:00 committed by GitHub
commit 4cdbebb86d
2 changed files with 13 additions and 6 deletions

View File

@ -325,8 +325,8 @@ namespace cheat::game::filters
WhitelistFilter DreamForm = { {EntityType__Enum_1::Field, EntityType__Enum_1::Platform }, "_AnimalSeelie" };
SimpleFilter StarlightCoalescence = { EntityType__Enum_1::Field, "_PaperStar" };
SimpleFilter TheRavenForum = { EntityType__Enum_1::Gadget, "_NightCrowStatue" };
WhitelistFilter TimeTrialChallengeCollection = { { EntityType__Enum_1::Field, EntityType__Enum_1::Gadget }, { "SkillObj_EmptyGadget", "_GlideChampOrb", "_DendroGlideChampOrb" } };
SimpleFilter Bombbarrel = { EntityType__Enum_1::Gadget, "_Bombbarrel" };
WhitelistFilter TimeTrialChallengeCollection = { { EntityType__Enum_1::Field, EntityType__Enum_1::Gadget }, { "SkillObj_EmptyGadget", "_GlideChampOrb", "_DendroGlideChampOrb", "_DreamlandSpirit" } };
SimpleFilter Bombbarrel = { EntityType__Enum_1::Gadget, { "_Bombbarrel", "_XuMiBombBox" } };
SimpleFilter NurseriesInTheWilds = { EntityType__Enum_1::Field, "PlantDrawStart" };
SimpleFilter SaghiraMachine = { EntityType__Enum_1::Gadget, "FatuiMaranaWell" };
SimpleFilter StonePillarSeal = { EntityType__Enum_1::Gadget, "GrassSealRing_" };

View File

@ -72,10 +72,17 @@ namespace cheat::feature
auto combat = entity->combat();
if (combat != nullptr)
{
auto combatProp = combat->fields._combatProperty_k__BackingField;
auto maxHP = app::MoleMole_SafeFloat_get_Value(combatProp->fields.maxHP, nullptr);
// so many entities named "SkillObj_EmptyGadget", but the collection's hp is 99999.f
if (maxHP > 99998 && maxHP < 99999.9)
if (entity->name().find("SkillObj_EmptyGadget") != std::string::npos)
{
auto combatProp = combat->fields._combatProperty_k__BackingField;
auto maxHP = app::MoleMole_SafeFloat_get_Value(combatProp->fields.maxHP, nullptr);
// so many entities named "SkillObj_EmptyGadget", but the collection's hp is 99999.f
if (maxHP > 99998 && maxHP < 99999.9)
{
entity->setRelativePosition(avatarEntity->relativePosition());
}
}
else
{
entity->setRelativePosition(avatarEntity->relativePosition());
}