summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-12 18:02:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-12 18:02:41 +0000
commit16c5028d6274e5c1a21dfcc0f26f926597ff2edd (patch)
tree18dafae15f96bf4403e492da64ea473513890760 /src
parent97353c7d82e3537982d2687f3b16a6c92e25b33b (diff)
downloadhercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.tar.gz
hercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.tar.bz2
hercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.tar.xz
hercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.zip
- Corrected range of self destruction / bio explosion to be equal to their splash range.
- Corrected Spider Web casting around caster instead of target's position - Corrected a possible crash during login due to checking for the incorrect variable (lets pc_calc_status be invoked when it shouldn't) - Reenabled the base status aspd calculation for homunc (status_calc_bl calculates battle_status, status_calc_homunculus calculates base_status, they are not the same!) - Corrected the meaning of "skill_display_fail&2", made 2 the default setting. - Added bounds checking to map_foreachincell - Opt2 values (poison, blind, and so on) are now resent on warp/map-change - Corrected description of isloggedin script command. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9853 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/clif.c3
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/skill.c37
-rw-r--r--src/map/status.c5
6 files changed, 30 insertions, 25 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d0fbdf291..9a427547c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4167,14 +4167,14 @@ int atcommand_stat_all(const int fd, struct map_session_data* sd, const char* co
*status[index] = new_value;
clif_updatestatus(sd, SP_STR + index);
clif_updatestatus(sd, SP_USTR + index);
- status_calc_pc(sd, 0);
count++;
}
}
- if (count > 0) // if at least 1 stat modified
+ if (count > 0) { // if at least 1 stat modified
+ status_calc_pc(sd, 0);
clif_displaymessage(fd, msg_txt(84)); // All stats changed!
- else {
+ } else {
if (value < 0)
clif_displaymessage(fd, msg_txt(177)); // Impossible to decrease a stat.
else
diff --git a/src/map/clif.c b/src/map/clif.c
index 4b642f84c..2645b55bb 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8298,6 +8298,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
clif_status_load(&sd->bl, SI_DEVIL, 1); //blindness [Komurka]
+ if (sd->sc.opt2) //Client loses these on warp.
+ clif_changeoption(&sd->bl);
+
clif_weather_check(sd);
map_foreachinarea(clif_getareachar,sd->bl.m,
diff --git a/src/map/map.c b/src/map/map.c
index af3f48ad0..02d3bbdeb 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -996,6 +996,8 @@ int map_foreachincell(int (*func)(struct block_list*,va_list),int m,int x,int y,
va_list ap;
int blockcount=bl_list_count,i,c;
+ if (x < 0 || y < 0 || x >= map[m].xs || y >= map[m].ys) return 0;
+
va_start(ap,type);
by=y/BLOCK_SIZE;
diff --git a/src/map/pc.c b/src/map/pc.c
index 4e9c93dc9..3fba85898 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -613,7 +613,7 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
if (battle_config.disp_zeny)
sd->state.showzeny = 1;
- if (battle_config.display_skill_fail&2)
+ if (!(battle_config.display_skill_fail&2))
sd->state.showdelay = 1;
// Request all registries.
diff --git a/src/map/skill.c b/src/map/skill.c
index f5283b9d8..8f003aa6b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5550,24 +5550,6 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
return 0;
}
- switch (ud->skillid) {
- //These should become skill_castend_pos
- case WE_CALLPARTNER:
- case WE_CALLPARENT:
- case WE_CALLBABY:
- case AM_RESURRECTHOMUN:
- case PF_SPIDERWEB:
- //Find a random spot to place the skill. [Skotlex]
- inf2 = skill_get_splash(ud->skillid, ud->skilllv);
- ud->skillx = src->x + inf2;
- ud->skilly = src->y + inf2;
- if (inf2 && !map_random_dir(src, &ud->skillx, &ud->skilly)) {
- ud->skillx = src->x;
- ud->skilly = src->y;
- }
- return skill_castend_pos(tid,tick,id,data);
- }
-
if(ud->skillid != SA_CASTCANCEL ) {
if( ud->skilltimer != tid ) {
ShowError("skill_castend_id: Timer mismatch %d!=%d!\n", ud->skilltimer, tid);
@@ -5584,12 +5566,31 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
else
target = map_id2bl(ud->skilltarget);
+
// Use a do so that you can break out of it when the skill fails.
do {
if(!target || target->prev==NULL) break;
if(src->m != target->m || status_isdead(src)) break;
+ switch (ud->skillid) {
+ //These should become skill_castend_pos
+ case WE_CALLPARTNER:
+ case WE_CALLPARENT:
+ case WE_CALLBABY:
+ case AM_RESURRECTHOMUN:
+ case PF_SPIDERWEB:
+ //Find a random spot to place the skill. [Skotlex]
+ inf2 = skill_get_splash(ud->skillid, ud->skilllv);
+ ud->skillx = target->x + inf2;
+ ud->skilly = target->y + inf2;
+ if (inf2 && !map_random_dir(target, &ud->skillx, &ud->skilly)) {
+ ud->skillx = target->x;
+ ud->skilly = target->y;
+ }
+ return skill_castend_pos(tid,tick,id,data);
+ }
+
if(ud->skillid == RG_BACKSTAP) {
int dir = map_calc_dir(src,target->x,target->y),t_dir = unit_getdir(target);
if(check_distance_bl(src, target, 0) || map_check_dir(dir,t_dir)) {
diff --git a/src/map/status.c b/src/map/status.c
index 3a5afa2ee..e3ad739cf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1530,7 +1530,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
int i,index;
int skill,refinedef=0;
- if(sd->state.connect_new && !(first&1)) //Shouldn't invoke yet until player is done loading.
+ if(!sd->state.auth && !(first&1)) //Shouldn't invoke yet until player is done loading.
return -1;
if (++calculating > 10) //Too many recursive calls!
@@ -2413,12 +2413,11 @@ int status_calc_homunculus(struct homun_data *hd, int first)
status->aspd_rate = 1000;
- /* //this calc is useless since status_calc_bl(SCB_ALL) does it already
skill = (1000 -4*status->agi -status->dex)
*hd->homunculusDB->baseASPD/1000;
status->amotion = cap_value(skill,battle_config.max_aspd,2000);
- status->adelay = status->amotion; //It seems adelay = amotion for Homunculus.*/
+ status->adelay = status->amotion; //It seems adelay = amotion for Homunculus.
status_calc_misc(&hd->bl, status, hom->level);
status_calc_bl(&hd->bl, SCB_ALL); //Status related changes.