From 9a8b87ff29883c2a8517a954921546108f881a88 Mon Sep 17 00:00:00 2001 From: Torwent Date: Wed, 20 Sep 2023 11:49:20 +0200 Subject: [PATCH] fix(magic): minor tweaks to magic tab --- osr/interfaces/gametabs/magic.simba | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/osr/interfaces/gametabs/magic.simba b/osr/interfaces/gametabs/magic.simba index 0787ec3b..f0b3bfc8 100644 --- a/osr/interfaces/gametabs/magic.simba +++ b/osr/interfaces/gametabs/magic.simba @@ -10,21 +10,15 @@ Extends SRL's TRSMagic. {$ENDIF} (* -Magic._CastedSpell +Magic.SpellWasCast ~~~~~~~~~~~~~~~~~~ -.. pascal:: function TRSMagic._CastedSpell(spell: ERSSpell): Boolean; +.. pascal:: function TRSMagic.SpellWasCast(spell: ERSSpell): Boolean; -Internal helper function for better logic of wether we casted a spell or not. -Used by WaspLib's TRSMagic.CastSpell() override. - -And yes, I know casted is not a word. +Internal helper function to decide wether we cast a spell or not. *) -function TRSMagic._CastedSpell(spell: ERSSpell): Boolean; +function TRSMagic.SpellWasCast(spell: ERSSpell): Boolean; override; begin - if Self.IsOpen() and (Self.GetSelectedSpell() = spell) then - Exit(True); - - Result := XPBar.EarnedXP() or Inventory.IsOpen(); + Result := inherited() or XPBar.EarnedXP(); end; (* @@ -50,9 +44,9 @@ begin if (selected <> ERSSpell.UNKNOWN) then Self.MouseSpell(selected, MOUSE_LEFT); - XPBar.EarnedXP(); //Make sure WL.PreviousXP is set to current XP. + XPBar.EarnedXP(); Result := Self.MouseSpell(spell, MOUSE_LEFT) and - WaitUntil(Self._CastedSpell(spell), 100, SRL.TruncatedGauss(1000, 2000)); + WaitUntil(Self.SpellWasCast(spell), 300, SRL.TruncatedGauss(1000, 2000)); end;