diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/party.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 330894a5c..eeafac7c4 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2008/04/06 + * Fixed a case where a dangling pointer was formed when a person was + - invited to a party immediately after creating their own. (r12518) [Kevin] * Sight rasher now affects the wizard's own and other's icewalls. (r12516) [Kevin] * Sight rasher, sight blaster, and arrow shower are now the only - three skills that will affect traps. (r12516) [Kevin] diff --git a/src/map/party.c b/src/map/party.c index 2d81e155c..1d59c476e 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -114,6 +114,9 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2) return 0; // "already in a party" } + //Temporarily set to -1 so cannot be spam invited + sd->status.party_id = -1; + party_fill_member(&leader, sd); leader.leader = 1; @@ -129,6 +132,8 @@ void party_created(int account_id,int char_id,int fail,int party_id,char *name) if (!sd || sd->status.char_id != char_id) { //Character logged off before creation ack? + if(sd) + sd->status.party_id = 0; if (!fail) //break up party since player could not be added to it. intif_party_leave(party_id,account_id,char_id); return; @@ -139,6 +144,7 @@ void party_created(int account_id,int char_id,int fail,int party_id,char *name) clif_party_created(sd,0); //Success message //We don't do any further work here because the char-server sends a party info packet right after creating the party. } else { + sd->status.party_id = 0; clif_party_created(sd,1); // "party name already exists" } } @@ -299,7 +305,7 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd) return 0; } - if( tsd->status.party_id>0 || tsd->party_invite>0 ){ + if( tsd->status.party_id!=0 || tsd->party_invite>0){ clif_party_inviteack(sd,tsd->status.name,0); return 0; } |