summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c23
-rw-r--r--src/char/int_party.c7
2 files changed, 16 insertions, 14 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 66ca0b317..66bfdd4ee 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -3147,7 +3147,7 @@ static void char_parse_frommap_map_names(int fd, int id)
static void char_send_scdata(int fd, int aid, int cid)
{
#ifdef ENABLE_SC_SAVING
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `type`, `tick`, `val1`, `val2`, `val3`, `val4` "
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `type`, `tick`, `total_tick`, `val1`, `val2`, `val3`, `val4` "
"FROM `%s` WHERE `account_id` = '%d' AND `char_id`='%d'",
scdata_db, aid, cid) )
{
@@ -3168,10 +3168,11 @@ static void char_send_scdata(int fd, int aid, int cid)
{
SQL->GetData(inter->sql_handle, 0, &data, NULL); scdata.type = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); scdata.tick = atoi(data);
- SQL->GetData(inter->sql_handle, 2, &data, NULL); scdata.val1 = atoi(data);
- SQL->GetData(inter->sql_handle, 3, &data, NULL); scdata.val2 = atoi(data);
- SQL->GetData(inter->sql_handle, 4, &data, NULL); scdata.val3 = atoi(data);
- SQL->GetData(inter->sql_handle, 5, &data, NULL); scdata.val4 = atoi(data);
+ SQL->GetData(inter->sql_handle, 2, &data, NULL); scdata.total_tick = atoi(data);
+ SQL->GetData(inter->sql_handle, 3, &data, NULL); scdata.val1 = atoi(data);
+ SQL->GetData(inter->sql_handle, 4, &data, NULL); scdata.val2 = atoi(data);
+ SQL->GetData(inter->sql_handle, 5, &data, NULL); scdata.val3 = atoi(data);
+ SQL->GetData(inter->sql_handle, 6, &data, NULL); scdata.val4 = atoi(data);
memcpy(WFIFOP(fd, 14+count*sizeof(struct status_change_data)), &scdata, sizeof(struct status_change_data));
}
if (count >= 50)
@@ -3741,14 +3742,14 @@ static void char_parse_frommap_save_status_change_data(int fd)
int i;
StrBuf->Init(&buf);
- StrBuf->Printf(&buf, "INSERT INTO `%s` (`account_id`, `char_id`, `type`, `tick`, `val1`, `val2`, `val3`, `val4`) VALUES ", scdata_db);
+ StrBuf->Printf(&buf, "INSERT INTO `%s` (`account_id`, `char_id`, `type`, `tick`, `total_tick`, `val1`, `val2`, `val3`, `val4`) VALUES ", scdata_db);
for( i = 0; i < count; ++i )
{
memcpy (&data, RFIFOP(fd, 14+i*sizeof(struct status_change_data)), sizeof(struct status_change_data));
if( i > 0 )
StrBuf->AppendStr(&buf, ", ");
- StrBuf->Printf(&buf, "('%d','%d','%hu','%d','%d','%d','%d','%d')", aid, cid,
- data.type, data.tick, data.val1, data.val2, data.val3, data.val4);
+ StrBuf->Printf(&buf, "('%d','%d','%hu','%d','%d','%d','%d','%d','%d')", aid, cid,
+ data.type, data.tick, data.total_tick, data.val1, data.val2, data.val3, data.val4);
}
if( SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) )
Sql_ShowDebug(inter->sql_handle);
@@ -3881,9 +3882,9 @@ static void char_parse_frommap_scdata_update(int fd)
short type = RFIFOW(fd, 10);
if (SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s`"
- " (`account_id`,`char_id`,`type`,`tick`,`val1`,`val2`,`val3`,`val4`)"
- " VALUES ('%d','%d','%d','%d','%d','%d','%d','%d')",
- scdata_db, account_id, char_id, type, INFINITE_DURATION, val1, val2, val3, val4)
+ " (`account_id`,`char_id`,`type`,`tick`,`total_tick`,`val1`,`val2`,`val3`,`val4`)"
+ " VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d')",
+ scdata_db, account_id, char_id, type, INFINITE_DURATION, INFINITE_DURATION, val1, val2, val3, val4)
) {
Sql_ShowDebug(inter->sql_handle);
}
diff --git a/src/char/int_party.c b/src/char/int_party.c
index c27d708f2..bf680c816 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -118,7 +118,6 @@ static void inter_party_calc_state(struct party_data *p)
p->party.exp = 0; //Set off even share.
mapif->party_optionchanged(0, &p->party, 0, 0);
}
- return;
}
// Save party to mysql
@@ -472,8 +471,11 @@ static bool inter_party_leave(int party_id, int account_id, int char_id)
mapif->party_withdraw(party_id, account_id, char_id);
j = p->party.member[i].lv;
- if (p->party.member[i].online > 0)
+ if (p->party.member[i].online > 0) {
+ p->party.member[i].online = 0;
p->party.count--;
+ }
+ inter_party->tosql(&p->party, PS_DELMEMBER, i);
memset(&p->party.member[i], 0, sizeof(struct party_member));
p->size--;
if (j == p->min_lv || j == p->max_lv || p->family) {
@@ -482,7 +484,6 @@ static bool inter_party_leave(int party_id, int account_id, int char_id)
}
if (inter_party->check_empty(p) == 0) {
- inter_party->tosql(&p->party, PS_DELMEMBER, i);
mapif->party_info(-1, &p->party, 0);
}
return true;