Browse Source

Fix

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@764 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber 20 năm trước cách đây
mục cha
commit
790063aae7
4 tập tin đã thay đổi với 20 bổ sung12 xóa
  1. 1 0
      Changelog.txt
  2. 8 4
      Dev/bugs.txt
  3. 10 6
      src/char_sql/char.c
  4. 1 2
      src/map/pc.c

+ 1 - 0
Changelog.txt

@@ -1,5 +1,6 @@
 Date	Added
 12/23
+        * Fixed skills still being available after a job change [MouseJstr]
         * Changed pc_alive_timer to use map_id2sd - should be more accurate [celest]
         * Added jA 1084's fix to mob.c - check whether the player is still alive
           when calculating exp [celest]

+ 8 - 4
Dev/bugs.txt

@@ -134,11 +134,15 @@ Progress:	-
 Notes:          It works differently now, you have to use it once to *allow* it to
                 activate, and once again to stop it from activating. ^^; [Celest]
 
-Problem:	When you change JOB, you don't lose skills in DB. It means if you were Merchant once 
+Problem:	When you change JOB, you don't lose skills in DB. It
+		means if you were Merchant once  
 		you can buy/sell with discount being Mage, etc.
-		Those skills aren't being shown in the skilltree, but they do work. 
-Assigned:	N/A
-Progress:	0%
+		Those skills aren't being shown in the skilltree, but
+		they do work. 
+                (fixed)
+
+Assigned:	MouseJstr
+Progress:	100%
 
 Problem:	Due to the Guilds CACHE we see some went-offline members as online ones. It is very confusing. You don't know who's really on.
 Assigned:	N/A

+ 10 - 6
src/char_sql/char.c

@@ -543,12 +543,16 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){
 	}
 
 	diff = 0;
-	for(i=0;i<MAX_SKILL;i++)
-	  if((p->skill[i].id != cp->skill[i].id) || (p->skill[i].lv != cp->skill[i].lv) ||
-	     (p->skill[i].flag != cp->skill[i].flag)) {
-	    diff = 1;
-	    break;
-	  }
+	for(i=0;i<MAX_SKILL;i++) {
+            if ((p.skill[i].lv != 0) && (p.skill[i].id == 0)) 
+                p->skill[i].id = i;
+
+            if((p->skill[i].id != cp->skill[i].id) || (p->skill[i].lv != cp->skill[i].lv) ||
+                (p->skill[i].flag != cp->skill[i].flag)) {
+                diff = 1;
+                break;
+            }
+        }
 
 	if (diff) {
 	//printf("- Save skill data to MySQL!\n");

+ 1 - 2
src/map/pc.c

@@ -416,8 +416,7 @@ int pc_makesavestatus(struct map_session_data *sd)
 	    sd->status.skill[i].id=0;
 	    sd->status.skill[i].lv=0;
 	    sd->status.skill[i].flag=0;
-	  } else if ((sd->status.skill[i].lv != 0) && (sd->status.skill[i].id == 0)) 
-	    sd->status.skill[i].id = i;
+	  }
 	}
 
 	return 0;