summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c10
-rw-r--r--src/map/pc.c22
2 files changed, 22 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e78c034cb..2dbe7cb96 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11177,7 +11177,15 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
/// Old clients send always 1 for this, even when using /str+ and the like.
/// Newer clients (2013-12-23 and newer) send the correct amount.
void clif_parse_StatusUp(int fd,struct map_session_data *sd) {
- pc->statusup(sd,RFIFOW(fd,2), RFIFOB(fd, 4));
+ int increase_amount;
+
+ increase_amount = RFIFOB(fd,4);
+ if( increase_amount < 0 )
+ {
+ ShowDebug("clif_parse_StatusUp: Negative 'increase' value sent by client! (fd: %d, value: %d)\n",
+ fd, increase_amount);
+ }
+ pc->statusup(sd, RFIFOW(fd,2), increase_amount);
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 268125ae1..249b5f0b1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -6220,7 +6220,7 @@ int pc_maxparameterincrease(struct map_session_data* sd, int type) {
/**
* Raises a stat by the specified amount.
* Obeys max_parameter limits.
- * Subtracts stat points.
+ * Does not subtract stat points.
*
* @param sd The target character.
* @param type The stat to change (see enum _sp)
@@ -6275,12 +6275,16 @@ bool pc_statusup(struct map_session_data* sd, int type, int increase) {
return true;
}
-/// Raises a stat by the specified amount.
-/// Obeys max_parameter limits.
-/// Does not subtract stat points.
-///
-/// @param type The stat to change (see enum _sp)
-/// @param val The stat increase amount.
+/**
+ * Raises a stat by the specified amount.
+ * Obeys max_parameter limits.
+ * Subtracts stat points.
+ *
+ * @param sd The target character.
+ * @param type The stat to change (see enum _sp)
+ * @param increase The stat increase amount.
+ * @return zero if no changes were made, otherwise returns stat increase amount
+ */
int pc_statusup2(struct map_session_data* sd, int type, int val)
{
int max, need;
@@ -6289,7 +6293,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
if( type < SP_STR || type > SP_LUK )
{
clif->statusupack(sd,type,0,0);
- return 1;
+ return 0;
}
need = pc->need_status_point(sd,type,1);
@@ -6309,7 +6313,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
if( val > 255 )
clif->updatestatus(sd,type); // send after the 'ack' to override the truncated value
- return 0;
+ return val;
}
/*==========================================