summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c36
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/charcommand.c3
3 files changed, 22 insertions, 19 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e62c9a71a..2501e633c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4138,7 +4138,7 @@ int atcommand_param(
int index, value = 0, new_value, max;
const char* param[] = { "@str", "@agi", "@vit", "@int", "@dex", "@luk", NULL };
short* status[6];
- //We don't use direct initialization because it isn't part of the C standard.
+ //we don't use direct initialization because it isn't part of the c standard.
nullpo_retr(-1, sd);
status[0] = &sd->status.str;
@@ -4167,18 +4167,15 @@ int atcommand_param(
clif_displaymessage(fd, atcmd_output);
return -1;
}
- if (value >0) {
- max = pc_maxparameter(sd);
- if (*status[index] > max - value)
- new_value = max;
- else
- new_value = *status[index] + value;
- } else {
- if (*status[index] <= -value)
- new_value = 1;
- else
- new_value = *status[index] + value;
- }
+
+ max = pc_maxparameter(sd);
+ if (value > 0 && *status[index] > max - value)
+ new_value = max;
+ else if (value < 0 && *status[index] <= -value)
+ new_value = 1;
+ else
+ new_value = *status[index] + value;
+
if (new_value != (int)*status[index]) {
*status[index] = new_value;
clif_updatestatus(sd, SP_STR + index);
@@ -4206,11 +4203,16 @@ int atcommand_stat_all(
const char* command, const char* message)
{
int index, count, value = 0, max, new_value;
- short* status[] = {
- &sd->status.str, &sd->status.agi, &sd->status.vit,
- &sd->status.int_, &sd->status.dex, &sd->status.luk
- };
+ short* status[6];
+ //we don't use direct initialization because it isn't part of the c standard.
nullpo_retr(-1, sd);
+
+ status[0] = &sd->status.str;
+ status[1] = &sd->status.agi;
+ status[2] = &sd->status.vit;
+ status[3] = &sd->status.int_;
+ status[4] = &sd->status.dex;
+ status[5] = &sd->status.luk;
if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0)
value = pc_maxparameter(sd);
diff --git a/src/map/battle.c b/src/map/battle.c
index 6986826f0..7301cac5c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1966,7 +1966,7 @@ static struct Damage battle_calc_weapon_attack(
{ //SG Anger bonus - ATK_ADDRATE [Komurka]
static int type[] = { SG_SUN_ANGER, SG_MOON_ANGER, SG_STAR_ANGER };
short t_class = status_get_class(target);
- if (sc->data && sc->data[SC_MIRACLE].timer!=-1 && (skill = pc_checkskill(sd,type[2])))
+ if (sc && sc->data[SC_MIRACLE].timer!=-1 && (skill = pc_checkskill(sd,type[2])))
{
skillratio = (sd->status.base_level + status_get_str(src) + status_get_dex(src)+ status_get_luk(src))/(skill<4?12-3*skill:1);
ATK_ADDRATE(skillratio);
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index 72a05288a..6c589473e 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -481,7 +481,7 @@ int charcommand_stats(
int value;
} output_table[] = {
{ "Base Level - %d", 0 },
- { job_jobname, 0 },
+ { NULL, 0 },
{ "Hp - %d", 0 },
{ "MaxHp - %d", 0 },
{ "Sp - %d", 0 },
@@ -497,6 +497,7 @@ int charcommand_stats(
};
//direct array initialization with variables is not standard C compliant.
output_table[0].value = pl_sd->status.base_level;
+ output_table[1].format = job_jobname;
output_table[1].value = pl_sd->status.job_level;
output_table[2].value = pl_sd->status.hp;
output_table[3].value = pl_sd->status.max_hp;