From 3e1b9de2a8a106d9471abbd1b232078eae268fbc Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 27 Oct 2013 19:27:09 -0200 Subject: Fixed Bug #7418 Item rentals now take place after status changes arrive, guaranteeing that items that expired cancel their effects properly. Thanks to kyeme, malufett. http://hercules.ws/board/tracker/issue-7418-setmount-boarding-hatler/ Signed-off-by: shennetsind --- src/char/char.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/char') diff --git a/src/char/char.c b/src/char/char.c index dcdab8d0a..310163e3a 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2849,8 +2849,7 @@ int parse_frommap(int fd) Sql_ShowDebug(sql_handle); break; } - if( SQL->NumRows(sql_handle) > 0 ) - { + if( SQL->NumRows(sql_handle) > 0 ) { struct status_change_data scdata; int count; char* data; @@ -2871,8 +2870,7 @@ int parse_frommap(int fd) } if (count >= 50) ShowWarning("Too many status changes for %d:%d, some of them were not loaded.\n", aid, cid); - if (count > 0) - { + if (count > 0) { WFIFOW(fd,2) = 14 + count*sizeof(struct status_change_data); WFIFOW(fd,12) = count; WFIFOSET(fd,WFIFOW(fd,2)); @@ -2881,6 +2879,14 @@ int parse_frommap(int fd) 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); } + } else { //no sc (needs a response) + WFIFOHEAD(fd,14); + WFIFOW(fd,0) = 0x2b1d; + WFIFOW(fd,2) = 14; + WFIFOL(fd,4) = aid; + WFIFOL(fd,8) = cid; + WFIFOW(fd,12) = 0; + WFIFOSET(fd,WFIFOW(fd,2)); } SQL->FreeResult(sql_handle); #endif -- cgit v1.2.3-70-g09d2