Browse Source

- Now when the char-txt server does not finds a requested party, it will clear out said party id of all characters (will help prevent massive spamming/overhead when for some reason the party file needs to be deleted).
- Combo skills (inf = self, inf2 = no target self) no longer check range if you use them while your attack-timer is still active.


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

skotlex 19 years ago
parent
commit
0f5a4717ef
6 changed files with 28 additions and 3 deletions
  1. 6 0
      Changelog-Trunk.txt
  2. 1 1
      db/skill_db.txt
  3. 14 0
      src/char/char.c
  4. 1 0
      src/char/char.h
  5. 3 1
      src/char/int_party.c
  6. 3 1
      src/map/unit.c

+ 6 - 0
Changelog-Trunk.txt

@@ -4,6 +4,12 @@ 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/07/21
+	* Now when the char-txt server does not finds a requested party, it will
+	  clear out said party id of all characters (will help prevent massive
+	  spamming/overhead when for some reason the party file needs to be deleted).
+	  [Skotlex]
+	* Combo skills (inf = self, inf2 = no target self) no longer check range if
+	  you use them while your attack-timer is still active. [Skotlex]
 	* Added back a map_freeblock call in skill_delunitgroup which caused a
 	  memory leak when removed... [Skotlex]
 	* Added a check to prevent Blind from ending while standing on a fog of

+ 1 - 1
db/skill_db.txt

@@ -1,6 +1,6 @@
 //id,range,hit,inf,pl,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count
 // 01 ID
-// 02 range
+// 02 range (combo skills do not check for range when used)
 // 03 hit (8- repeated hitting, 6- single-hit)
 // 04 inf (0- passive, 1- enemy, 2- place, 4- self, 16- friend, 32- trap)
 // 05 pl attributes (0- nothing, 1- water, 2- earth, 3- fire, 4- wind, 5- poison, 6- saint, 7- darkness, 8- sense, 9- immortality)

+ 14 - 0
src/char/char.c

@@ -1749,6 +1749,20 @@ int char_family(int cid1, int cid2, int cid3) {
 		return 1; //cid2/cid3 parents. cid1 child.
 	return 0;
 }
+
+//Clears the given party id from all characters.
+//Since sometimes the party format changes and parties must be wiped, this 
+//method is required to prevent stress during the "party not found!" stages.
+void char_clearparty(int party_id) 
+{
+	int i;
+	for(i = 0; i < char_num; i++)
+  	{
+		if (char_dat[i].status.party_id == party_id)
+			char_dat[i].status.party_id = 0;
+	}
+}
+
 //------------------------------------------------------------
 // E-mail check: return 0 (not correct) or 1 (valid). by [Yor]
 //------------------------------------------------------------

+ 1 - 0
src/char/char.h

@@ -34,6 +34,7 @@ int mapif_send(int fd,unsigned char *buf, unsigned int len);
 int char_married(int pl1,int pl2);
 int char_child(int parent_id, int child_id);
 int char_family(int cid1, int cid2, int cid3);
+void char_clearparty(int party_id);
 
 int char_log(char *fmt, ...);
 

+ 3 - 1
src/char/int_party.c

@@ -529,8 +529,10 @@ int mapif_parse_PartyInfo(int fd, int party_id) {
 	p = idb_get(party_db, party_id);
 	if (p != NULL)
 		mapif_party_info(fd, &p->party);
-	else
+	else {
 		mapif_party_noinfo(fd, party_id);
+		char_clearparty(party_id);
+	}
 
 	return 0;
 }

+ 3 - 1
src/map/unit.c

@@ -846,7 +846,9 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
 		}
 	}
 
-	if(src->id != target_id &&
+	//Check range when not using skill on yourself or is a combo-skill during attack
+	//(these are supposed to always have the same range as your attack)
+	if(src->id != target_id && (!temp || ud->attacktimer == -1) &&
 		!battle_check_range(src,target,skill_get_range2(src, skill_num,skill_lv)
 		+(skill_num==RG_CLOSECONFINE?0:1))) //Close confine is exploitable thanks to this extra range "feature" of the client. [Skotlex]
 		return 0;