mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user