summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-11 17:25:49 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-11 17:25:49 +0000
commit45edb97481f5bf680311121db4b33bb00a07a081 (patch)
treedd7dfaa95e786340520fe9161a9fcf0aa87162d4 /src/map/party.c
parentb57366763f2d0900404ea045dd1208f077c0c2c3 (diff)
downloadhercules-45edb97481f5bf680311121db4b33bb00a07a081.tar.gz
hercules-45edb97481f5bf680311121db4b33bb00a07a081.tar.bz2
hercules-45edb97481f5bf680311121db4b33bb00a07a081.tar.xz
hercules-45edb97481f5bf680311121db4b33bb00a07a081.zip
- Corrected /invite letting you invite people even if you are not the party leader.
- Added some reply messages when you try /invite and a. the character is not found or b. you are not the party leader. - Added a check so that the 'save on crash' routine won't get stuck if it happens to crash while attempting to save characters. - People in chat-rooms no longer receive @main messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11179 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 6ae42a9f1..763b553e1 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -9,6 +9,7 @@
#include "../common/showmsg.h"
#include "party.h"
+#include "atcommand.h" //msg_txt()
#include "pc.h"
#include "map.h"
#include "battle.h"
@@ -259,15 +260,28 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
int i,flag=0;
nullpo_retr(0, sd);
+ if (p==NULL)
+ return 0;
- if(tsd==NULL || p==NULL)
+ if(tsd==NULL) { //TODO: Find the correct reply packet.
+ clif_displaymessage(sd->fd, msg_txt(3));
+ return 0;
+ }
+ //Only leader can invite.
+ ARR_FIND(0, MAX_PARTY, i, i < MAX_PARTY && p->data[i].sd != sd);
+ if (i == MAX_PARTY || !p->party.member[i].leader)
+ { //TODO: Find the correct reply packet.
+ clif_displaymessage(sd->fd, msg_txt(282));
return 0;
+ }
+
if(!battle_config.invite_request_check) {
if (tsd->guild_invite>0 || tsd->trade_partner) {
clif_party_inviteack(sd,tsd->status.name,0);
return 0;
}
}
+
if (!tsd->fd) { //You can't invite someone who has already disconnected.
clif_party_inviteack(sd,tsd->status.name,1);
return 0;