Skip to content

Commit

Permalink
fix: small fixes to the latest PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Dec 12, 2024
1 parent ed0a1a6 commit 19aaacb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions optional/handlers/combathandler.simba
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,9 @@ end;

function TRSCombatHandler.NeedAntiPoison(): Boolean;
begin
if not Self.HandleConsumables[ERSConsumable.POISON] and
not Self.HandleConsumables[ERSConsumable.VENOM] then
Exit;
if not Self.HandleConsumables[ERSConsumable.POISON] then Exit;

Result := PoisonHandler.NeedToConsume() or VenomHandler.NeedToConsume() or
Minimap.IsPoisoned() or Minimap.IsEnvenomed();
Result := PoisonHandler.NeedToConsume() or Minimap.IsPoisoned() or Minimap.IsEnvenomed();
end;

function TRSCombatHandler.NeedConsumable(consumable: ERSConsumable): Boolean;
Expand Down Expand Up @@ -666,9 +663,6 @@ begin

if Self.NeedAntiPoison() then
begin
if Self.HandleConsumables[ERSConsumable.VENOM] and Inventory.ContainsConsumable(ERSConsumable.VENOM) then
Exit(ECombatState.DRINK_ANTIVENOM);

if Self.HandleConsumables[ERSConsumable.POISON] and Inventory.ContainsConsumable(ERSConsumable.POISON) then
Exit(ECombatState.DRINK_ANTIPOISON);
end;
Expand Down Expand Up @@ -794,7 +788,7 @@ begin
if Self.BuryBones and Inventory.ContainsAny(REMAINS) then
Exit(ECombatState.BURY_BONES);

if Self.UseSafeSpot and not (Self.Monster.Walker^.Position = Self.SafeSpot) then
if Self.UseSafeSpot and (Self.Monster.Walker^.Position <> Self.SafeSpot) then
Exit(ECombatState.SAFE_SPOT);

if Self.IsFighting then
Expand All @@ -818,7 +812,6 @@ begin
ECombatState.EAT_FOOD: Self.Consume(ERSConsumable.FOOD);
ECombatState.DRINK_PRAYER: Self.Consume(ERSConsumable.PRAYER);
ECombatState.DRINK_ANTIFIRE: Self.Consume(ERSConsumable.ANTI_FIRE);
ECombatState.DRINK_ANTIVENOM: Self.Consume(ERSConsumable.VENOM);
ECombatState.DRINK_ANTIPOISON: Self.Consume(ERSConsumable.POISON);
ECombatState.DRINK_STR_BOOST: Self.Consume(ERSConsumable.STRENGTH_BOOST);
ECombatState.DRINK_ATK_BOOST: Self.Consume(ERSConsumable.ATTACK_BOOST);
Expand Down

0 comments on commit 19aaacb

Please sign in to comment.