summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-07 20:38:33 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-07 20:38:33 +0000
commitb2aec3fdf96913c1ebe69957d7c8d556988e6af2 (patch)
tree092c9193ace099c13eaea28af418fcfadcb1cdff /src/map/clif.c
parent6b93f724139c3ab1e74c68ce79a79ecb525848f8 (diff)
downloadhercules-b2aec3fdf96913c1ebe69957d7c8d556988e6af2.tar.gz
hercules-b2aec3fdf96913c1ebe69957d7c8d556988e6af2.tar.bz2
hercules-b2aec3fdf96913c1ebe69957d7c8d556988e6af2.tar.xz
hercules-b2aec3fdf96913c1ebe69957d7c8d556988e6af2.zip
- Fixed some bugs on auction.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12318 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 694e6d987..6470ebb86 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11769,12 +11769,11 @@ static void clif_Auction_setitem(int fd, int index, bool fail)
WFIFOSET(fd,packet_len(0x256));
}
-void clif_parse_Auction_registerwindow(int fd, struct map_session_data *sd)
+void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd)
{
- // RFIFOW(fd,2):
- // = 0 means player opened the register window
- // = 1 means player press the Cancel button, in that window.
- // But... if player just enter the register window and press X to close, no packet is send.
+ if( sd->auction.amount > 0 )
+ clif_additem(sd, sd->auction.index, sd->auction.amount, 0);
+
sd->auction.amount = 0;
}
@@ -11787,7 +11786,7 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
if( sd->auction.amount > 0 )
sd->auction.amount = 0;
- if( idx < 0 || idx > MAX_INVENTORY )
+ if( idx < 0 || idx >= MAX_INVENTORY )
{
ShowWarning("Character %s trying to set invalid item index in auctions.\n", sd->status.name);
return;
@@ -11813,7 +11812,7 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
sd->auction.index = idx;
sd->auction.amount = amount;
- clif_Auction_setitem(fd, idx, false);
+ clif_Auction_setitem(fd, idx + 2, false);
}
// 0 = You have failed to bid into the auction
@@ -11921,6 +11920,8 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd)
char search_text[NAME_LENGTH];
short type = RFIFOW(fd,2);
int price = RFIFOL(fd,4);
+
+ clif_parse_Auction_cancelreg(fd, sd);
safestrncpy(search_text, (char*)RFIFOP(fd,8), NAME_LENGTH);
intif_Auction_requestlist(sd->status.char_id, type, price, search_text);
@@ -11931,6 +11932,8 @@ void clif_parse_Auction_buysell(int fd, struct map_session_data* sd)
short type = RFIFOW(fd,2) + 6;
char search_text[NAME_LENGTH];
+ clif_parse_Auction_cancelreg(fd, sd);
+
memset(&search_text, '\0', NAME_LENGTH);
intif_Auction_requestlist(sd->status.char_id, type, 0, search_text);
}
@@ -12469,7 +12472,7 @@ static int packetdb_readdb(void)
{clif_parse_Auction_search,"auctionsearch"},
{clif_parse_Auction_buysell,"auctionbuysell"},
{clif_parse_Auction_setitem,"auctionsetitem"},
- {clif_parse_Auction_registerwindow,"auctionregisterwindow"},
+ {clif_parse_Auction_cancelreg,"auctioncancelreg"},
{clif_parse_Auction_register,"auctionregister"},
#endif
{clif_parse_cashshop_buy,"cashshopbuy"},