Rework raid invite handling, shouldn't break rsay being invited to raid anymore

This commit is contained in:
Michael Cook (mackal) 2014-12-03 17:04:26 -05:00
parent 804421095a
commit fc282f86c0

View File

@ -10617,12 +10617,18 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
case RaidCommandInviteIntoExisting:
case RaidCommandInvite: {
Client *i = entity_list.GetClientByName(ri->player_name);
if (i){
if (!i)
break;
Group *g = i->GetGroup();
if (g){
if (g->IsLeader(i) == false)
// These two messages should be generated by the client I think, just do this for now
if (i->HasRaid()) {
Message(13, "%s is already in a raid.", i->GetName());
break;
}
if (g && !g->IsLeader(i)) {
Message(13, "You can only invite an ungrouped player or group leader to join your raid.");
else{
break;
}
//This sends an "invite" to the client in question.
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
RaidGeneral_Struct *rg = (RaidGeneral_Struct*)outapp->pBuffer;
@ -10633,21 +10639,6 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
rg->action = 20;
i->QueuePacket(outapp);
safe_delete(outapp);
}
}
else{
//This sends an "invite" to the client in question.
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
RaidGeneral_Struct *rg = (RaidGeneral_Struct*)outapp->pBuffer;
strn0cpy(rg->leader_name, ri->leader_name, 64);
strn0cpy(rg->player_name, ri->player_name, 64);
rg->parameter = 0;
rg->action = 20;
i->QueuePacket(outapp);
safe_delete(outapp);
}
}
break;
}
case RaidCommandAcceptInvite: {