Explorar el Código

update

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@550 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber hace 20 años
padre
commit
d774c37adc
Se han modificado 9 ficheros con 22 adiciones y 11 borrados
  1. 12 1
      Changelog.txt
  2. 1 1
      src/common/mmo.h
  3. 2 2
      src/map/chat.c
  4. 1 1
      src/map/clif.c
  5. 1 1
      src/map/guild.c
  6. 1 1
      src/map/mob.c
  7. 1 1
      src/map/npc.c
  8. 1 1
      src/map/pc.c
  9. 2 2
      src/map/trade.c

+ 12 - 1
Changelog.txt

@@ -1,6 +1,17 @@
 Date	Added
 12/13
-        * Internal MAIL system: moved all strings to msg_athena.conf [Lupus]
+	* Increased max skills to 650 from 450 fixing MANY crashes [MouseJstr]
+	* Creating Guild events were reading beyond supplied guild names ,
+	  causing crashes [MouseJstr
+	* trades were derefing -2 into the inventory table sometimes [MouseJstr]
+	* Not having a arrow in your inventory but having a bow
+	  could cause it to set sd->status.inventory[-1].equip=32768
+	  resulting in a memory corruption [MouseJstr]
+	* local broadcasts of messages larger then 64 bytes were
+	  corrupting the stack, causing crashes [MouseJstr]
+	* mob eventnames were reading beyond source point, risking
+	  going over page boundries, causing crashes [MouseJstr]
+	* Internal MAIL system: moved all strings to msg_athena.conf [Lupus]
 
 12/12
         * Made guild skills to check for skill levels first when casting [celest]

+ 1 - 1
src/common/mmo.h

@@ -29,7 +29,7 @@
 #define MAX_AMOUNT 30000
 #define MAX_ZENY 1000000000	// 1G zeny
 #define MAX_CART 100
-#define MAX_SKILL 450
+#define MAX_SKILL 650
 #define GLOBAL_REG_NUM 96
 #define ACCOUNT_REG_NUM 16
 #define ACCOUNT_REG2_NUM 16

+ 2 - 2
src/map/chat.c

@@ -275,7 +275,7 @@ int chat_createnpcchat(struct npc_data *nd,int limit,int pub,int trigger,char* t
 		cd->trigger = trigger;
 	cd->pub = pub;
 	cd->users = 0;
-	memcpy(cd->pass,"",8);
+	memcpy(cd->pass,"",1);
 	if(titlelen>=sizeof(cd->title)-1) titlelen=sizeof(cd->title)-1;
 	memcpy(cd->title,title,titlelen);
 	cd->title[titlelen]=0;
@@ -286,7 +286,7 @@ int chat_createnpcchat(struct npc_data *nd,int limit,int pub,int trigger,char* t
 	cd->bl.type = BL_CHAT;
 	cd->owner_ = (struct block_list *)nd;
 	cd->owner = &cd->owner_;
-	memcpy(cd->npc_event,ev,sizeof(cd->npc_event));
+	memcpy(cd->npc_event,ev,strlen(ev));
 
 	cd->bl.id = map_addobject(&cd->bl);	
 	if(cd->bl.id==0){

+ 1 - 1
src/map/clif.c

@@ -9030,7 +9030,7 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) {
  *------------------------------------------
  */
 void clif_parse_LGMmessage(int fd, struct map_session_data *sd) {
-	unsigned char buf[64];
+	unsigned char buf[512];
 
 	nullpo_retv(sd);
 

+ 1 - 1
src/map/guild.c

@@ -364,7 +364,7 @@ int guild_npc_request_info(int guild_id,const char *event)
 		return guild_request_info(guild_id);
 
 	ev=(struct eventlist *)aCalloc(1,sizeof(struct eventlist));
-	memcpy(ev->name,event,sizeof(ev->name));
+	memcpy(ev->name,event,strlen(event));
 	ev->next=(struct eventlist *)numdb_search(guild_infoevent_db,guild_id);
 	numdb_insert(guild_infoevent_db,guild_id,ev);
 	return guild_request_info(guild_id);

+ 1 - 1
src/map/mob.c

@@ -184,7 +184,7 @@ int mob_once_spawn(struct map_session_data *sd,char *mapname,
 		md->spawndelay1=-1;	// 一度のみフラグ
 		md->spawndelay2=-1;	// 一度のみフラグ
 
-		memcpy(md->npc_event,event,sizeof(md->npc_event));
+		memcpy(md->npc_event,event,strlen(event));
 
 		md->bl.type=BL_MOB;
 		map_addiddb(&md->bl);

+ 1 - 1
src/map/npc.c

@@ -2013,7 +2013,7 @@ static int npc_parse_mapflag(char *w1,char *w2,char *w3,char *w4)
 //ƒ}ƒbƒvƒtƒ‰ƒO
 	if ( strcmpi(w3,"nosave")==0) {
 		if (strcmp(w4,"SavePoint")==0) {
-			memcpy(map[m].save.map,"SavePoint",16);
+			memcpy(map[m].save.map,"SavePoint",10);
 			map[m].save.x=-1;
 			map[m].save.y=-1;
 		}else if (sscanf(w4,"%[^,],%d,%d",savemap,&savex,&savey)==3) {

+ 1 - 1
src/map/pc.c

@@ -6762,7 +6762,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos)
 		clif_changelook(&sd->bl,LOOK_SHOES,0);
 
 	pc_checkallowskill(sd);	// ?備品でスキルか解除されるかチェック
-	if (itemdb_look(sd->status.inventory[n].nameid) == 11 && arrow){	// Added by RoVeRT
+	if (itemdb_look(sd->status.inventory[n].nameid) == 11 && (arrow >= 0)){	// Added by RoVeRT
 		clif_arrowequip(sd,arrow);
 		sd->status.inventory[arrow].equip=32768;
 	}

+ 2 - 2
src/map/trade.c

@@ -142,8 +142,8 @@ void trade_tradeok(struct map_session_data *sd)
 	nullpo_retv(sd);
 	
 	for(trade_i=0;trade_i<10;trade_i++) {
-		if(sd->deal_item_amount[trade_i]>sd->status.inventory[sd->deal_item_index[trade_i]-2].amount ||
-			sd->deal_item_amount[trade_i]<0) {
+		int idx = sd->deal_item_index[trade_i]-2;
+		if(((idx >= 0) && (sd->deal_item_amount[trade_i]>sd->status.inventory[idx].amount)) || sd->deal_item_amount[trade_i]<0) {
 			trade_tradecancel(sd);
 			return;
 		}