Selaa lähdekoodia

- Fixed Spider Web fire damage bonus.
- Made Global chat always reply back to you even on @/# commands, this prevents the client from muting yourself due to "hack". However, this same fix isn't easily applicable to @ commands invoked from whispers or party/guild messages, those are still pending.
- Some fixes in socket.c


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

skotlex 18 vuotta sitten
vanhempi
commit
df7e54c3df
4 muutettua tiedostoa jossa 21 lisäystä ja 16 poistoa
  1. 5 0
      Changelog-Trunk.txt
  2. 4 3
      src/common/socket.c
  3. 2 2
      src/map/battle.c
  4. 10 11
      src/map/clif.c

+ 5 - 0
Changelog-Trunk.txt

@@ -5,6 +5,11 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/09/18
+	* Fixed Spider Web fire damage bonus. [Skotlex]
+	* Made Global chat always reply back to you even on @/# commands, this
+	  prevents the client from muting yourself due to "hack". However, this same
+	  fix isn't easily applicable to @ commands invoked from whispers or
+	  party/guild messages, those are still pending. [Skotlex]
 	* Merged Meruru's update to socket.c, which includes a rewritten parse
 	  function, which should hopefully be more efficient than the previous code.
 	  [Skotlex]

+ 4 - 3
src/common/socket.c

@@ -62,7 +62,10 @@ int ip_rules = 1;
 #define TCP_FRAME_LEN	1024
 #endif
 
-#ifndef MINCORE
+static int mode_neg=1;
+static int frame_size=TCP_FRAME_LEN;
+
+#ifndef MINICORE
 enum {
 	ACO_DENY_ALLOW=0,
 	ACO_ALLOW_DENY,
@@ -75,8 +78,6 @@ static int access_order=ACO_DENY_ALLOW;
 static int access_allownum=0;
 static int access_denynum=0;
 static int access_debug=0;
-static int mode_neg=1;
-static int frame_size=TCP_FRAME_LEN;
 static int ddos_count     = 10;
 static int ddos_interval  = 3000;
 static int ddos_autoreset = 600*1000;

+ 2 - 2
src/map/battle.c

@@ -201,8 +201,6 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
 			ratio += enchant_eff[sc->data[SC_VIOLENTGALE].val1-1];
 		if(sc->data[SC_DELUGE].timer!=-1 && atk_elem == ELE_WATER)
 			ratio += enchant_eff[sc->data[SC_DELUGE].val1-1];
-		if(sc->data[SC_SPIDERWEB].timer!=-1 && atk_elem == ELE_FIRE) // [Celest]
-			damage *= 2; //FIXME: Double damage instead of double ratio?
 	}
 	if (tsc && tsc->count)
 	{
@@ -214,6 +212,8 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
 			if (tsc->data[SC_ARMOR_ELEMENT].val3 == atk_elem)
 				ratio -= tsc->data[SC_ARMOR_ELEMENT].val4;
 		}
+		if(tsc->data[SC_SPIDERWEB].timer!=-1 && atk_elem == ELE_FIRE) // [Celest]
+			damage <<= 1;
 	}
 	return damage*ratio/100;
 }

+ 10 - 11
src/map/clif.c

@@ -5834,8 +5834,6 @@ int clif_party_created(struct map_session_data *sd,int flag)
 {
 	int fd;
 
-	// printf("clif_party_message(%s, %d, %s)\n", p->name, account_id, mes);
-
 	nullpo_retr(0, sd);
 
 	fd=sd->fd;
@@ -8673,9 +8671,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
 		return;
 	}
 	
-	if ((is_atcommand(fd, sd, message, 0) != AtCommand_None) ||
-		(is_charcommand(fd, sd, message,0) != CharCommand_None))
-		return;
 	if (sd->sc.count &&
 		(sd->sc.data[SC_BERSERK].timer != -1 ||
 		(sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)))
@@ -8687,7 +8682,16 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
 			return;
 		sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
 	}
-	
+
+	// To prevent client auto-muting, always send global chat back to self.
+	memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
+	WFIFOW(fd,0) = 0x8e;
+	WFIFOSET(fd, WFIFOW(fd,2));
+
+	if ((is_atcommand(fd, sd, message, 0) != AtCommand_None) ||
+		(is_charcommand(fd, sd, message,0) != CharCommand_None))
+		return;
+
 	if (RFIFOW(fd,2)+4 < 128)
 		buf = buf2; //Use a static buffer.
 	else
@@ -8702,11 +8706,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
 
 	if(buf != buf2) aFree(buf);
 
-	// send back message to the speaker
-	memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
-	WFIFOW(fd,0) = 0x8e;
-	WFIFOSET(fd, WFIFOW(fd,2));
-
 #ifdef PCRE_SUPPORT
 	map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, message, strlen(message), &sd->bl);
 	map_foreachinrange(mob_chat_sub, &sd->bl, AREA_SIZE, BL_MOB, message, strlen(message), &sd->bl);