summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-09 04:11:30 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-09 04:11:30 +0000
commitb53b29469f5c27f3715f7f31f61e33a387de7663 (patch)
treeddad25bf34a0df958fb2d78028606527d18823d1 /src/map/atcommand.c
parentd0f11e8df04bd9f791e93e616ca816c79c8158ba (diff)
downloadhercules-b53b29469f5c27f3715f7f31f61e33a387de7663.tar.gz
hercules-b53b29469f5c27f3715f7f31f61e33a387de7663.tar.bz2
hercules-b53b29469f5c27f3715f7f31f61e33a387de7663.tar.xz
hercules-b53b29469f5c27f3715f7f31f61e33a387de7663.zip
New Battle Config: gm.conf/atcommand_max_stat_bypass for bugreport:3301
-- Allows you to choose whether your gms can bypass your server's max stat limit or not. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15046 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c0a834593..e0fb1c309 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3065,7 +3065,7 @@ ACMD_FUNC(zeny)
*------------------------------------------*/
ACMD_FUNC(param)
{
- int i, value = 0, new_value;
+ int i, value = 0, new_value, max;
const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" };
short* status[6];
//we don't use direct initialization because it isn't part of the c standard.
@@ -3094,16 +3094,16 @@ ACMD_FUNC(param)
status[4] = &sd->status.dex;
status[5] = &sd->status.luk;
- if(value < 0 && *status[i] <= -value)
- {
- new_value = 1;
- }
- else if(SHRT_MAX - *status[i] < value)
- {
- new_value = SHRT_MAX;
- }
+ if( battle_config.atcommand_max_stat_bypass )
+ max = SHRT_MAX;
else
- {
+ max = pc_maxparameter(sd);
+
+ if(value < 0 && *status[i] <= -value) {
+ new_value = 1;
+ } else if(max - *status[i] < value) {
+ new_value = max;
+ } else {
new_value = *status[i] + value;
}
@@ -3145,7 +3145,10 @@ ACMD_FUNC(stat_all)
value = pc_maxparameter(sd);
max = pc_maxparameter(sd);
} else {
- max = SHRT_MAX;
+ if( battle_config.atcommand_max_stat_bypass )
+ max = SHRT_MAX;
+ else
+ max = pc_maxparameter(sd);
}
count = 0;