summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-29 12:31:12 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-29 12:31:12 +0000
commit73ced774f2fee93de2881356144ba539d3396118 (patch)
treebb11c01510757d75e71540aba01d950f881a9d69
parentbcbd358d4f57a7f51cb80dd829db6576824939ab (diff)
downloadhercules-73ced774f2fee93de2881356144ba539d3396118.tar.gz
hercules-73ced774f2fee93de2881356144ba539d3396118.tar.bz2
hercules-73ced774f2fee93de2881356144ba539d3396118.tar.xz
hercules-73ced774f2fee93de2881356144ba539d3396118.zip
* Fixed players could add themselves to their friendslist through their clones or WPE (bugreport:4909).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14835 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/clif.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 3eca9764d..0c44c479f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,7 @@
Date Added
2011/05/29
+ * Fixed players could add themselves to their friendslist through their clones or WPE (bugreport:4909). [Ai4rei]
* Fixed bonus 'bHPDrainValue' on left hand would work as right hand bonus, when specified with 'bonus' rather than 'bonus2' (bugreport:4939, since r6221). [Ai4rei]
2011/05/23
* Changed enumerating defines into enumerations (related topic:264007). [Ai4rei]
diff --git a/src/map/clif.c b/src/map/clif.c
index 81ab49799..c9796a8e4 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11989,6 +11989,11 @@ void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd)
f_sd = map_nick2sd((char*)RFIFOP(fd,2));
+ if( sd->bl.id == f_sd->bl.id )
+ {// adding oneself as friend
+ return;
+ }
+
// Friend doesn't exist (no player with this name)
if (f_sd == NULL) {
clif_displaymessage(fd, msg_txt(3));
@@ -12037,6 +12042,11 @@ void clif_parse_FriendsListReply(int fd, struct map_session_data *sd)
char_id = RFIFOL(fd,6);
reply = RFIFOB(fd,10);
+ if( sd->bl.id == account_id )
+ {// adding oneself as friend
+ return;
+ }
+
f_sd = map_id2sd(account_id); //The account id is the same as the bl.id of players.
if (f_sd == NULL)
return;