Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/cypher_proxy' into cypher_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 5, 2022
2 parents 5206684 + e7c8ed7 commit b8ace3f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions HermesProxy/World/Client/PacketHandlers/SpellHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,12 @@ SpellCastData HandleSpellStartOrGo(WorldPacket packet, bool isSpellGo)
[PacketHandler(Opcode.SMSG_CANCEL_AUTO_REPEAT)]
void HandleCancelAutoRepeat(WorldPacket packet)
{
if (GetSession().GameState.CurrentClientSpecialCast != null &&
GameData.AutoRepeatSpells.Contains(GetSession().GameState.CurrentClientSpecialCast.SpellId))
{
GetSession().GameState.CurrentClientSpecialCast = null;
}

CancelAutoRepeat cancel = new CancelAutoRepeat();
if (LegacyVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
cancel.Guid = packet.ReadPackedGuid().To128(GetSession().GameState);
Expand Down
7 changes: 4 additions & 3 deletions HermesProxy/World/GameData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public static class GameData
public static HashSet<uint> DispellSpells = new HashSet<uint>();
public static HashSet<uint> StackableAuras = new HashSet<uint>();
public static HashSet<uint> MountAuras = new HashSet<uint>();
public static HashSet<uint> NextMeleeAndAutoRepeatSpells = new HashSet<uint>();
public static HashSet<uint> NextMeleeSpells = new HashSet<uint>();
public static HashSet<uint> AutoRepeatSpells = new HashSet<uint>();

// From Server
public static Dictionary<uint, CreatureTemplate> CreatureTemplates = new Dictionary<uint, CreatureTemplate>();
Expand Down Expand Up @@ -618,7 +619,7 @@ public static void LoadMeleeSpells()
string[] fields = csvParser.ReadFields();

uint spellId = UInt32.Parse(fields[0]);
NextMeleeAndAutoRepeatSpells.Add(spellId);
NextMeleeSpells.Add(spellId);
}
}
}
Expand All @@ -641,7 +642,7 @@ public static void LoadAutoRepeatSpells()
string[] fields = csvParser.ReadFields();

uint spellId = UInt32.Parse(fields[0]);
NextMeleeAndAutoRepeatSpells.Add(spellId);
AutoRepeatSpells.Add(spellId);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion HermesProxy/World/Server/PacketHandlers/SpellHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public void SendCastRequestFailed(ClientCastRequest castRequest, bool isPet)
[PacketHandler(Opcode.CMSG_CAST_SPELL)]
void HandleCastSpell(CastSpell cast)
{
if (GameData.NextMeleeAndAutoRepeatSpells.Contains(cast.Cast.SpellID))
if (GameData.NextMeleeSpells.Contains(cast.Cast.SpellID) ||
GameData.AutoRepeatSpells.Contains(cast.Cast.SpellID))
{
ClientCastRequest castRequest = new ClientCastRequest();
castRequest.Timestamp = Time.UnixTime;
Expand Down

0 comments on commit b8ace3f

Please sign in to comment.