summaryrefslogtreecommitdiff
path: root/src/map/elemental.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-22 20:33:06 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-22 20:33:06 +0000
commit082687fc204c7b40bf676ad710c2488048571b73 (patch)
tree59b356c4d4cc86122ef42c46d9500ddeb93ba6bc /src/map/elemental.c
parenta31d779891778d76d1c0fac3544e6dd1627da98a (diff)
downloadhercules-082687fc204c7b40bf676ad710c2488048571b73.tar.gz
hercules-082687fc204c7b40bf676ad710c2488048571b73.tar.bz2
hercules-082687fc204c7b40bf676ad710c2488048571b73.tar.xz
hercules-082687fc204c7b40bf676ad710c2488048571b73.zip
Major cleanup all over the place, made possible by mkbu95's scan-build report he provided us with.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16687 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/elemental.c')
-rw-r--r--src/map/elemental.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 9a9a3d4f5..ae3c738d8 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -605,14 +605,14 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_
target = map_id2bl(ed->ud.target);
if( !target )
- map_foreachinrange(elemental_ai_sub_timer_activesearch, &ed->bl, ed->db->range2, BL_CHAR, ed, &target, status_get_mode(&ed->bl));
+ map_foreachinrange(elemental_ai_sub_timer_activesearch, &ed->bl, view_range, BL_CHAR, ed, &target, status_get_mode(&ed->bl));
if( !target ) { //No targets available.
elemental_unlocktarget(ed);
return 1;
}
- if( battle_check_range(&ed->bl,target,ed->db->range2) && rnd()%100 < 2 ) { // 2% chance to cast attack skill.
+ if( battle_check_range(&ed->bl,target,view_range) && rnd()%100 < 2 ) { // 2% chance to cast attack skill.
if( elemental_action(ed,target,tick) )
return 1;
}
@@ -786,7 +786,6 @@ int read_elemental_skilldb(void) {
skillmode = atoi(str[3]);
if( skillmode < EL_SKILLMODE_PASIVE || skillmode > EL_SKILLMODE_AGGRESSIVE ) {
ShowError("read_elemental_skilldb : Skillmode out of range, line %d.\n",k);
- skillmode = EL_SKILLMODE_PASIVE;
continue;
}
ARR_FIND( 0, MAX_ELESKILLTREE, i, db->skill[i].id == 0 || db->skill[i].id == skillid );