summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/guild.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 00d538f0b..38b3da6b9 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.
2006/06/09
+ * Added an error report and correction when the map server receives a guild
+ from the char-server with more guild members than MAX_GUILD. [Skotlex]
* Changed the interval between waterballs back to 125 [MasterOfMuppets]
* Fixed a typo in char_sql/char.c, thanks to Euph [MasterOfMuppets]
2006/06/08
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)