Status Saving

Fixed status saving in general, now cart will always be loaded.
This commit is contained in:
Lemongrass3110 2014-01-22 21:32:00 +01:00
parent ef0515873e
commit 3f1242edfd
2 changed files with 4 additions and 9 deletions

View File

@ -3308,10 +3308,6 @@ int parse_frommap(int fd)
WFIFOW(fd,2) = 14 + count*sizeof(struct status_change_data);
WFIFOW(fd,12) = count;
WFIFOSET(fd,WFIFOW(fd,2));
//Clear the data once loaded.
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `account_id` = '%d' AND `char_id`='%d'", scdata_db, aid, cid) )
Sql_ShowDebug(sql_handle);
}
}
Sql_FreeResult(sql_handle);
@ -3715,8 +3711,10 @@ int parse_frommap(int fd)
cid = RFIFOL(fd, 8);
count = RFIFOW(fd, 12);
if( count > 0 )
{
// Whatever comes from the mapserver, now is the time to drop previous entries
if( Sql_Query( sql_handle, "DELETE FROM `%s` where `account_id` = %d and `char_id` = %d;", scdata_db, aid, cid ) != SQL_SUCCESS ){
Sql_ShowDebug( sql_handle );
}else if( count > 0 ){
struct status_change_data data;
StringBuf buf;
int i;

View File

@ -1296,9 +1296,6 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the
count++;
}
if (count == 0)
return 0; //Nothing to save.
WFIFOW(char_fd,12) = count;
WFIFOW(char_fd,2) = 14 +count*sizeof(struct status_change_data); //Total packet size
WFIFOSET(char_fd,WFIFOW(char_fd,2));