summaryrefslogtreecommitdiff
path: root/src/char_sql/int_auction.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/char_sql/int_auction.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/char_sql/int_auction.c')
-rw-r--r--src/char_sql/int_auction.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/char_sql/int_auction.c b/src/char_sql/int_auction.c
index f8adfddd2..dc915e8c1 100644
--- a/src/char_sql/int_auction.c
+++ b/src/char_sql/int_auction.c
@@ -81,7 +81,7 @@ void auction_save(struct auction_data *auction)
StringBuf_Destroy(&buf);
}
-static bool auction_create(struct auction_data *auction)
+unsigned int auction_create(struct auction_data *auction)
{
int j;
@@ -121,7 +121,7 @@ static bool auction_create(struct auction_data *auction)
auction->auction_id = (unsigned int)SqlStmt_LastInsertId(stmt);
auction->auction_end_timer = add_timer( gettick() + tick , auction_end_timer, auction->auction_id, 0);
- ShowInfo("New Auction Created: id %u | time left %d ms | Created by %s.\n", auction->auction_id, tick, auction->seller_name);
+ ShowInfo("New Auction %u | time left %d ms | By %s.\n", auction->auction_id, tick, auction->seller_name);
CREATE(auction_, struct auction_data, 1);
memcpy(auction_, auction, sizeof(struct auction_data));
@@ -131,7 +131,7 @@ static bool auction_create(struct auction_data *auction)
SqlStmt_Free(stmt);
StringBuf_Destroy(&buf);
- return (auction->auction_id > 0);
+ return auction->auction_id;
}
static int auction_end_timer(int tid, unsigned int tick, int id, int data)
@@ -302,8 +302,8 @@ static void mapif_parse_Auction_requestlist(int fd)
(type == 1 && auction->type != IT_WEAPON) ||
(type == 2 && auction->type != IT_CARD) ||
(type == 3 && auction->type != IT_ETC) ||
- (type == 4 && auction->price > price) ||
- (type == 5 && strstr(auction->item_name, searchtext)) ||
+ (type == 4 && !strstr(auction->item_name, searchtext)) ||
+ (type == 5 && auction->price > price) ||
(type == 6 && auction->seller_id != char_id) ||
(type == 7 && auction->buyer_id != char_id) )
continue;
@@ -320,7 +320,7 @@ static void mapif_Auction_register(int fd, struct auction_data *auction)
{
int len = sizeof(struct auction_data) + 4;
- WFIFOHEAD(fd, len);
+ WFIFOHEAD(fd,len);
WFIFOW(fd,0) = 0x3851;
WFIFOW(fd,2) = len;
memcpy(WFIFOP(fd,4), auction, sizeof(struct auction_data));
@@ -335,7 +335,7 @@ static void mapif_parse_Auction_register(int fd)
memcpy(&auction, RFIFOP(fd,4), sizeof(struct auction_data));
if( auction_count(auction.seller_id, false) < 5 )
- auction_create(&auction);
+ auction.auction_id = auction_create(&auction);
mapif_Auction_register(fd, &auction);
}