From e0fff5c212007819f29a3406629967d36bc6ede1 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Tue, 13 Feb 2007 00:07:24 +0000 Subject: - A bit more work on Ticket #41. - Added 'r' (variable reference) to the script argument definitions. - Added a simple define for suspitious actions. (empty at the moment) - Added clif_clearcart and moved sending cart packets to pc_setoption. - clif_parse_ChangeCart checking the player level. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9857 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index fdd548913..26312a138 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2391,6 +2391,15 @@ void clif_cartlist(struct map_session_data *sd) return; } +/// Client behaviour: +/// Closes the cart storage and removes all it's items from memory. +/// The Num & Weight values of the cart are left untouched and the cart is NOT removed. +void clif_clearcart(int fd) +{ + WFIFOHEAD(fd, packet_len(0x12b)); + WFIFOW(fd,0) = 0x12b; +} + // Guild XY locators [Valaris] int clif_guild_xy(struct map_session_data *sd) { @@ -9612,8 +9621,19 @@ void clif_parse_RemoveOption(int fd,struct map_session_data *sd) */ void clif_parse_ChangeCart(int fd,struct map_session_data *sd) { + int type; + RFIFOHEAD(fd); - pc_setcart(sd,RFIFOW(fd,2)); + type = (int)RFIFOW(fd,2); + + if( (type == 5 && sd->status.base_level <= 90) || + (type == 4 && sd->status.base_level <= 80) || + (type == 3 && sd->status.base_level <= 65) || + (type == 2 && sd->status.base_level <= 40) || + pc_setcart(sd,type) ) + { + LOG_SUSPICIOUS(sd,"clif_parse_ChangeCart: player doesn't have the required level"); + } } /*========================================== -- cgit v1.2.3-70-g09d2