Use ActorControlFlags to check item use in battles

This commit is contained in:
Liza 2024-11-22 02:12:56 +01:00
parent 6c1c66971d
commit 145a989a07
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

@ -142,7 +142,7 @@ internal sealed class ItemUseModule : ICombatModule
{
BattleChara* battleChara = (BattleChara*)gameObject.Address;
if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.Incapacitated)
return (*(byte*)((nint)battleChara + 0x1C68) & 0x40) != 0;
return (battleChara->ActorControlFlags & 0x40) != 0;
if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.HealthPercent)
return (100f * battleChara->Health / battleChara->MaxHealth) < _combatData.CombatItemUse.Value;