Skip to content

Commit

Permalink
[Bug Fix] Fix EVENT_USE_SKILL with Sense Heading (#4424)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinglykrab authored Jul 23, 2024
1 parent 098498d commit 29fdf7e
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions zone/client_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,7 @@ void MapOpcodes()
ConnectedOpcodes[OP_Save] = &Client::Handle_OP_Save;
ConnectedOpcodes[OP_SaveOnZoneReq] = &Client::Handle_OP_SaveOnZoneReq;
ConnectedOpcodes[OP_SelectTribute] = &Client::Handle_OP_SelectTribute;

// Use or Ignore sense heading based on rule.
bool train = RuleB(Skills, TrainSenseHeading);

ConnectedOpcodes[OP_SenseHeading] =
(train) ? &Client::Handle_OP_SenseHeading : &Client::Handle_OP_Ignore;

ConnectedOpcodes[OP_SenseHeading] = &Client::Handle_OP_SenseHeading;
ConnectedOpcodes[OP_SenseTraps] = &Client::Handle_OP_SenseTraps;
ConnectedOpcodes[OP_SetGuildMOTD] = &Client::Handle_OP_SetGuildMOTD;
ConnectedOpcodes[OP_SetRunMode] = &Client::Handle_OP_SetRunMode;
Expand Down Expand Up @@ -13610,14 +13604,24 @@ void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app)

void Client::Handle_OP_SenseHeading(const EQApplicationPacket *app)
{
if (!HasSkill(EQ::skills::SkillSenseHeading))
if (!HasSkill(EQ::skills::SkillSenseHeading)) {
return;
}

int chancemod = 0;
if (RuleB(Skills, TrainSenseHeading)) {
CheckIncreaseSkill(EQ::skills::SkillSenseHeading, nullptr, 0);
return;
}

CheckIncreaseSkill(EQ::skills::SkillSenseHeading, nullptr, chancemod);
if (parse->PlayerHasQuestSub(EVENT_USE_SKILL)) {
const auto& export_string = fmt::format(
"{} {}",
EQ::skills::SkillSenseHeading,
GetRawSkill(EQ::skills::SkillSenseHeading)
);

return;
parse->EventPlayer(EVENT_USE_SKILL, this, export_string, 0);
}
}

void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
Expand Down

0 comments on commit 29fdf7e

Please sign in to comment.