summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-13 00:07:24 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-13 00:07:24 +0000
commite0fff5c212007819f29a3406629967d36bc6ede1 (patch)
tree1f7d447baa3ca8e9191069033c7b81c11a841365 /src/map/pc.c
parent95c694908ba1c7636e28f93f181e23927c5f8c5f (diff)
downloadhercules-e0fff5c212007819f29a3406629967d36bc6ede1.tar.gz
hercules-e0fff5c212007819f29a3406629967d36bc6ede1.tar.bz2
hercules-e0fff5c212007819f29a3406629967d36bc6ede1.tar.xz
hercules-e0fff5c212007819f29a3406629967d36bc6ede1.zip
- 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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 3fba85898..ee30f5bc8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5737,15 +5737,18 @@ int pc_setoption(struct map_session_data *sd,int type)
}
if(type&OPTION_CART && !(p_type&OPTION_CART))
{ //Cart On
+ clif_cartlist(sd);
+ clif_updatestatus(sd, SP_CARTINFO);
if(pc_checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Apply speed penalty.
} else
if(!(type&OPTION_CART) && p_type&OPTION_CART)
{ //Cart Off
+ clif_clearcart(sd->fd);
if(pc_checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Remove speed penalty.
}
-
+
if (type&OPTION_FALCON && !(p_type&OPTION_FALCON)) //Falcon ON
clif_status_load(&sd->bl,SI_FALCON,1);
else if (!(type&OPTION_FALCON) && p_type&OPTION_FALCON) //Falcon OFF
@@ -5784,27 +5787,22 @@ int pc_setoption(struct map_session_data *sd,int type)
*/
int pc_setcart(struct map_session_data *sd,int type)
{
- int cart[6]={0x0000,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5};
+ int cart[6] = {0x0000,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5};
int option;
+
nullpo_retr(0, sd);
-
- if (type < 0 || type > 5)
- return 0; //Never trust the values sent by the client! [Skotlex]
- if(pc_checkskill(sd,MC_PUSHCART)>0){ // プッシュカ?トスキル所持
- option = sd->sc.option;
- //This should preserve the current option, only modifying the cart bit.
- option&=~OPTION_CART;
- option|=cart[type];
- if(!pc_iscarton(sd)){ // カ?トを付けていない
- pc_setoption(sd,option);
- clif_cartlist(sd);
- clif_updatestatus(sd,SP_CARTINFO);
- }
- else{
- pc_setoption(sd,option);
- }
- }
+ if( type < 0 || type > 5 )
+ return 1;// Never trust the values sent by the client! [Skotlex]
+
+ if( pc_checkskill(sd,MC_PUSHCART) <= 0 )
+ return 1;// Push cart is required
+
+ // Update option
+ option = sd->sc.option;
+ option &= ~OPTION_CART;// clear cart bits
+ option |= cart[type]; // set cart
+ pc_setoption(sd, option);
return 0;
}