diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 13:54:37 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 13:54:37 +0000 |
commit | 8711b3099048ccacaa84f52fef06e4c6ded4aa4b (patch) | |
tree | 30ebf59a02f2f8b31d1ebd4a775eb3a9a653a06a /src/map/guild.c | |
parent | 4b87d42d9a57f3d3995a78da3c8557955f717c3e (diff) | |
download | hercules-8711b3099048ccacaa84f52fef06e4c6ded4aa4b.tar.gz hercules-8711b3099048ccacaa84f52fef06e4c6ded4aa4b.tar.bz2 hercules-8711b3099048ccacaa84f52fef06e4c6ded4aa4b.tar.xz hercules-8711b3099048ccacaa84f52fef06e4c6ded4aa4b.zip |
- Added an error report and correction when the map server receives a guild from the char-server with more guild members than MAX_GUILD.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7072 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r-- | src/map/guild.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index 9fa9d16c6..bef4f0c31 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -566,6 +566,13 @@ int guild_recv_info(struct guild *sg) before=*g;
memcpy(g,sg,sizeof(struct guild));
+ if(g->max_member > MAX_GUILD)
+ {
+ if (battle_config.error_log)
+ ShowError("guild_recv_info: Received guild with %d members, but MAX_GUILD is only %d. Extra guild-members have been lost!\n", g->max_member, MAX_GUILD);
+ g->max_member = MAX_GUILD;
+ }
+
for(i=bm=m=0;i<g->max_member;i++){ // sdの設定と人数の確認
if(g->member[i].account_id>0){
struct map_session_data *sd = map_id2sd(g->member[i].account_id);
@@ -962,7 +969,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin //Send XY dot updates. [Skotlex]
//Moved from guild_send_memberinfoshort [LuzZza]
- for(i=0; i < MAX_GUILD; i++) {
+ for(i=0; i < g->max_member; i++) {
if(!g->member[i].sd || i == idx ||
g->member[i].sd->bl.m != g->member[idx].sd->bl.m)
|