Переглянути джерело

- Fixed bugreport:6915, where @follow would still be enabled when the target/source died;
- Fixed a exploit on the creation char process, the hair color and style could be bypassed (bugreport:6916).

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

momacabu 12 роки тому
батько
коміт
53e6f0df04
2 змінених файлів з 8 додано та 6 видалено
  1. 3 0
      src/char/char.c
  2. 5 6
      src/map/pc.c

+ 3 - 0
src/char/char.c

@@ -1493,6 +1493,9 @@ int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int ag
 	|| (str + int_ != 10 || agi + luk != 10 || vit + dex != 10) ) // pairs
 #endif
 		return -2; // invalid input
+		
+	if (hair_style > 17 || hair_color > 8)
+		return -2;
 
 	// check the number of already existing chars in this account
 	if( char_per_account != 0 ) {

+ 5 - 6
src/map/pc.c

@@ -5458,14 +5458,13 @@ int pc_follow_timer(int tid, unsigned int tick, int id, intptr_t data)
 	}
 
 	sd->followtimer = INVALID_TIMER;
-	if (pc_isdead(sd))
-		return 0;
-
-	if ((tbl = map_id2bl(sd->followtarget)) == NULL)
-		return 0;
+	tbl = map_id2bl(sd->followtarget);
 
-	if(status_isdead(tbl))
+	if (tbl == NULL || pc_isdead(sd) || status_isdead(tbl))
+	{
+		pc_stop_following(sd);
 		return 0;
+	}
 
 	// either player or target is currently detached from map blocks (could be teleporting),
 	// but still connected to this map, so we'll just increment the timer and check back later