[Bug Fix] AutoSplit unknown bug and cleanup. (#4401)

Code Credit TAKP:

Bug Post: https://discord.com/channels/212663220849213441/1258430167764832319

Resolved issue with split message being sent to group members when no split is present which creates an "Unknown Split".

Also added the random remainder split portion unless using a manual /split

Converted manual messages to Strings
This commit is contained in:
Fryguy
2024-07-07 00:53:57 -04:00
committed by GitHub
parent d8ddd0aab9
commit c7a88af11a
4 changed files with 43 additions and 25 deletions
+9 -7
View File
@@ -14868,14 +14868,15 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app)
Group *group = nullptr;
Raid *raid = nullptr;
if (IsRaidGrouped())
if (IsRaidGrouped()) {
raid = GetRaid();
else if (IsGrouped())
} else if (IsGrouped()) {
group = GetGroup();
}
// is there an actual error message for this?
if (raid == nullptr && group == nullptr) {
Message(Chat::Red, "You can not split money if you're not in a group.");
MessageString(Chat::Red, SPLIT_NO_GROUP);
return;
}
@@ -14883,14 +14884,15 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app)
10 * static_cast<uint64>(split->silver) +
100 * static_cast<uint64>(split->gold) +
1000 * static_cast<uint64>(split->platinum))) {
Message(Chat::Red, "You do not have enough money to do that split.");
MessageString(Chat::Red, SPLIT_FAIL);
return;
}
if (raid)
if (raid) {
raid->SplitMoney(raid->GetGroup(this), split->copper, split->silver, split->gold, split->platinum);
else if (group)
group->SplitMoney(split->copper, split->silver, split->gold, split->platinum, this);
} else if (group) {
group->SplitMoney(split->copper, split->silver, split->gold, split->platinum, this, true);
}
return;