Sfoglia il codice sorgente

update

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@868 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber 20 anni fa
parent
commit
24dc7ec574
3 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 1 0
      Changelog.txt
  2. 6 0
      src/map/intif.c
  3. 6 0
      src/map/pc.c

+ 1 - 0
Changelog.txt

@@ -1,5 +1,6 @@
 Date	Added
 12/29
+	* Fix account register wipe issue (SVN 868) [MouseJstr]
 	* Double storage/lag exploit fixed (SVN 867) [MouseJstr]
 	* Another -1 alive_timer fix (SVN 866) [MouseJstr]
 	* Added @dmstart and @dmtick for debugging malloc tests [MouseJstr]

+ 6 - 0
src/map/intif.c

@@ -196,6 +196,9 @@ int intif_saveaccountreg(struct map_session_data *sd) {
 
 	nullpo_retr(0, sd);
 
+	if (sd->status.account_reg_num == -1)
+		return 0;
+
 	WFIFOW(inter_fd,0) = 0x3004;
 	WFIFOL(inter_fd,4) = sd->bl.id;
 	for(j=0,p=8;j<sd->status.account_reg_num;j++,p+=36){
@@ -216,6 +219,9 @@ int intif_request_accountreg(struct map_session_data *sd)
 	WFIFOW(inter_fd,0) = 0x3005;
 	WFIFOL(inter_fd,2) = sd->bl.id;
 	WFIFOSET(inter_fd,6);
+
+	sd->status.account_reg_num = -1;
+
 	return 0;
 }
 

+ 6 - 0
src/map/pc.c

@@ -6583,6 +6583,12 @@ int pc_setaccountreg(struct map_session_data *sd,char *reg,int val)
 
 	nullpo_retr(0, sd);
 
+	if (sd->status.account_reg_num == -1) {
+		if(battle_config.error_log)
+			printf("pc_setaccountreg : refusing to set until vars are received\n");
+		return 1;
+	}
+
 	if(val==0){
 		for(i=0;i<sd->status.account_reg_num;i++){
 			if(strcmp(sd->status.account_reg[i].str,reg)==0){