diff options
author | shennetsind <ind@henn.et> | 2013-10-27 19:27:09 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-10-27 19:27:09 -0200 |
commit | 3e1b9de2a8a106d9471abbd1b232078eae268fbc (patch) | |
tree | e9a4c977f13e0b7e25d960d2658cb1f56edae1b4 /src/char | |
parent | 6c1996a050e03408e55333c1efa1034ae25b9a00 (diff) | |
download | hercules-3e1b9de2a8a106d9471abbd1b232078eae268fbc.tar.gz hercules-3e1b9de2a8a106d9471abbd1b232078eae268fbc.tar.bz2 hercules-3e1b9de2a8a106d9471abbd1b232078eae268fbc.tar.xz hercules-3e1b9de2a8a106d9471abbd1b232078eae268fbc.zip |
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 <ind@henn.et>
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 14 |
1 files changed, 10 insertions, 4 deletions
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 |