Explorar el Código

- cbasetypes now assumes that Mingwin does defines ssize_t
- Modified the guild master change ack packet to return the aid/cid of the new guild master instead of the index where it was, the previous method could cause problems in situations where the order of guild members would not match exactly between char/map servers.
- Updated the Soul Linker's Rogue Spirit Stealth's speed bonus to +60%, according to forum infor from ragnagate.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9985 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex hace 18 años
padre
commit
7691130732
Se han modificado 8 ficheros con 36 adiciones y 18 borrados
  1. 7 0
      Changelog-Trunk.txt
  2. 5 4
      src/char/int_guild.c
  3. 5 4
      src/char_sql/int_guild.c
  4. 2 1
      src/common/cbasetypes.h
  5. 13 5
      src/map/guild.c
  6. 1 1
      src/map/guild.h
  7. 2 2
      src/map/intif.c
  8. 1 1
      src/map/status.c

+ 7 - 0
Changelog-Trunk.txt

@@ -3,6 +3,13 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/03/12
+	* Modified the guild master change ack packet to return the aid/cid of the
+	  new guild master instead of the index where it was, the previous method
+	  could cause problems in situations where the order of guild members would
+	  not match exactly between char/map servers.
+	* Updated the Soul Linker's Rogue Spirit Stealth's speed bonus to +60%,
+	  according to forum infor from ragnagate. [Skotlex]
 2007/03/09
 	* Mapcache can run on system with any endianness.
 	  The generated file contains data in little endian.

+ 5 - 4
src/char/int_guild.c

@@ -877,13 +877,14 @@ int mapif_guild_emblem(struct guild *g) {
 	return 0;
 }
 
-int mapif_guild_master_changed(struct guild *g, int position)
+int mapif_guild_master_changed(struct guild *g, int aid, int cid)
 {
 	unsigned char buf[12];
 	WBUFW(buf,0)=0x3843;
 	WBUFL(buf,2)=g->guild_id;
-	WBUFL(buf,6)=position;
-	mapif_sendall(buf,10);
+	WBUFL(buf,6)=aid;
+	WBUFL(buf,10)=cid;
+	mapif_sendall(buf,14);
 	return 0;
 }
 
@@ -1517,7 +1518,7 @@ int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int le
 		g->master[len] = '\0';
 
 	ShowInfo("int_guild: Guildmaster Changed to %s (Guild %d - %s)\n",name, guild_id, g->name);
-	return mapif_guild_master_changed(g, pos);
+	return mapif_guild_master_changed(g, g->member[0].account_id, g->member[0].char_id);
 }
 
 // map server ‚©‚ç‚Ì’Ê�M

+ 5 - 4
src/char_sql/int_guild.c

@@ -1199,13 +1199,14 @@ int mapif_guild_emblem(struct guild *g)
 	return 0;
 }
 
-int mapif_guild_master_changed(struct guild *g, int position)
+int mapif_guild_master_changed(struct guild *g, int aid, int cid)
 {
 	unsigned char buf[10];
 	WBUFW(buf,0)=0x3843;
 	WBUFL(buf,2)=g->guild_id;
-	WBUFL(buf,6)=position;
-	mapif_sendall(buf,10);
+	WBUFL(buf,6)=aid;
+	WBUFL(buf,10)=cid;
+	mapif_sendall(buf,14);
 	return 0;
 }
 
@@ -2043,7 +2044,7 @@ int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int le
 
 	ShowInfo("int_guild: Guildmaster Changed to %s (Guild %d - %s)\n",g->master, guild_id, g->name);
 	g->save_flag |= (GS_BASIC|GS_MEMBER); //Save main data and member data.
-	return mapif_guild_master_changed(g, pos);
+	return mapif_guild_master_changed(g, g->member[0].account_id, g->member[0].char_id);
 }
 
 // ƒMƒ‹ƒhƒ`ƒFƒbƒN—v‹�

+ 2 - 1
src/common/cbasetypes.h

@@ -153,7 +153,8 @@ typedef unsigned long int   ppuint32;
 // integer with exact processor width (and best speed)
 //						size_t already defined in stdio.h
 //////////////////////////////
-#ifdef WIN32 // does not have a signed size_t
+//
+#if defined(WIN32) && !defined(MINGW) // does not have a signed size_t
 //////////////////////////////
 #if defined(_WIN64)	// naive 64bit windows platform
 typedef __int64			ssize_t;

+ 13 - 5
src/map/guild.c

@@ -1603,16 +1603,24 @@ int guild_gm_change(int guild_id, struct map_session_data *sd)
 }
 
 //Notification from Char server that a guild's master has changed. [Skotlex]
-int guild_gm_changed(int guild_id, int pos)
+int guild_gm_changed(int guild_id, int account_id, int char_id)
 {
 	struct guild *g;
 	struct guild_member gm;
-	
+	int pos;
+
 	g=guild_search(guild_id);
-	
-	if (!g || pos < 0 || pos > g->max_member)
+
+	if (!g)
 		return 0;
-	
+
+	for(pos=0; pos<g->max_member && !(
+		g->member[pos].account_id==account_id &&
+		g->member[pos].char_id==char_id);
+		pos++);
+
+	if (pos == 0 || pos == g->max_member) return 0;
+
 	memcpy(&gm, &g->member[pos], sizeof (struct guild_member));
 	memcpy(&g->member[pos], &g->member[0], sizeof(struct guild_member));
 	memcpy(&g->member[0], &gm, sizeof(struct guild_member));

+ 1 - 1
src/map/guild.h

@@ -76,7 +76,7 @@ int guild_skillupack(int guild_id,int skill_num,int account_id);
 int guild_break(struct map_session_data *sd,char *name);
 int guild_broken(int guild_id,int flag);
 int guild_gm_change(int guild_id, struct map_session_data *sd);
-int guild_gm_changed(int guild_id, int pos);
+int guild_gm_changed(int guild_id, int account_id, int char_id);
 
 int guild_addcastleinfoevent(int castle_id,int index,const char *name);
 int guild_castledataload(int castle_id,int index);

+ 2 - 2
src/map/intif.c

@@ -31,7 +31,7 @@ static const int packet_len_table[]={
 	-1, 7, 0, 0,  0, 0, 0, 0, -1,11, 0, 0,  0, 0,  0, 0, //0x3810
 	39,-1,15,15, 14,19, 7,-1,  0, 0, 0, 0,  0, 0,  0, 0, //0x3820
 	10,-1,15, 0, 79,19, 7,-1,  0,-1,-1,-1, 14,67,186,-1, //0x3830
-	 9, 9,-1,10,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0, //0x3840
+	 9, 9,-1,14,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0, //0x3840
 	 0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0,
 	 0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0,
 	 0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0,
@@ -1366,7 +1366,7 @@ int intif_parse_GuildCastleAllDataLoad(int fd)
 int intif_parse_GuildMasterChanged(int fd)
 {
 	RFIFOHEAD(fd);
-	return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6));
+	return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
 }
 
 // pet

+ 1 - 1
src/map/status.c

@@ -5174,7 +5174,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 			val2 = tick>0?tick:10000; //Interval at which SP is drained.
 			val3 = 65+val1*5; //Speed adjustment.
 			if (sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_ROGUE)
-				val3 += 10; //TODO: Figure out real bonus. Temp value +10%
+				val3 += 60;
 			val4 = 10+val1*2; //SP cost.
 			if (map_flag_gvg(bl->m)) val4 *= 5;
 			break;