summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-22 01:13:28 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-22 01:13:28 +0000
commit078fe1c3ff072c85ca14a3465b0fc9d8a523711f (patch)
treea5673dc034fe5beafa040810683a09d509006032 /src/map/pc.c
parent88a2f6741ec3aee559495a219d499ecc3425a3f1 (diff)
downloadhercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.tar.gz
hercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.tar.bz2
hercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.tar.xz
hercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.zip
-Apply EvilPuncker path from tid:71756
-Fix and upd logzeny enumeration type bugreport:6897 -Upd @zeny to send a message when succed bugreport:6886 -Upd ChaosPanic to affect all bugreport:6893 -Upd bloodylust cooldown and disable endure effect bugreport:6547 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16940 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 2b9401841..abb99a865 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3588,7 +3588,7 @@ int pc_inventoryblank(struct map_session_data *sd)
*------------------------------------------*/
int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd)
{
- nullpo_ret(sd);
+ nullpo_retr(-1,sd);
zeny = cap_value(zeny,-MAX_ZENY,MAX_ZENY); //prevent command UB
if( zeny < 0 )
@@ -3716,7 +3716,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
*------------------------------------------*/
int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd)
{
- nullpo_ret(sd);
+ nullpo_retr(-1,sd);
zeny = cap_value(zeny,-MAX_ZENY,MAX_ZENY); //prevent command UB
if( zeny < 0 )
@@ -3848,6 +3848,10 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
/*==========================================
* Remove an item at index n from inventory by amount.
+ * Parameters :
+ * @type
+ * 1 : don't notify deletion
+ * 2 : don't notify weight change
* Return:
* 0 = success
* 1 = invalid itemid or negative amount
@@ -4200,7 +4204,7 @@ int pc_useitem(struct map_session_data *sd,int n)
/* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */
if( sd->inventory_data[n]->flag.delay_consume ) {
- if( nameid != 12622 && sd->sc.option&OPTION_MOUNTING )
+ if( nameid != ITEMID_REINS_OF_MOUNT && sd->sc.option&OPTION_MOUNTING )
return 0;
else if( pc_issit(sd) )
return 0;
@@ -6661,7 +6665,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
{
base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
if(base_penalty)
- pc_payzeny(sd, base_penalty, LOG_TYPE_OTHER, NULL); //@TODO that type suck
+ pc_payzeny(sd, base_penalty, LOG_TYPE_PICKDROP_PLAYER, NULL);
}
}
@@ -6871,7 +6875,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
case SP_ZENY:
if( val < 0 )
return 0;// can't set negative zeny
- log_zeny(sd, LOG_TYPE_NPC, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
+ log_zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
sd->status.zeny = cap_value(val, 0, MAX_ZENY);
break;
case SP_BASEEXP: