summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-15 10:27:05 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-15 10:27:05 +0000
commitc0f2069689110d1df816d52e36d049d4b97a7a22 (patch)
tree79b5d2a9dbaff90eaf32470e1fd586f8c7ad43aa /src/map/skill.c
parentf51be442a0990eb5755e10346abaeb94404af2b1 (diff)
downloadhercules-c0f2069689110d1df816d52e36d049d4b97a7a22.tar.gz
hercules-c0f2069689110d1df816d52e36d049d4b97a7a22.tar.bz2
hercules-c0f2069689110d1df816d52e36d049d4b97a7a22.tar.xz
hercules-c0f2069689110d1df816d52e36d049d4b97a7a22.zip
- Fixed a bunch of invalid memory access bugs as reported by Valgrind.
- Updated unit_stop_walking to not move character an extra cell when it is already half-way there unless flag 0x4 is passed. (bugreport:3078) - Fixed the monster MD_CASTSENSOR code not correctly setting the monster's aggressive state. - Corrected a few compiler warnings - Changed a bit the code for SC_BOSSMAPINFO so it is not so hideously ugly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13774 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 8ea6ca7b5..cc3c034dc 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5904,7 +5904,8 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr data)
if(battle_config.skill_log && battle_config.skill_log&src->type)
ShowInfo("Type %d, ID %d skill castend pos [id =%d, lv=%d, (%d,%d)]\n",
src->type, src->id, ud->skillid, ud->skilllv, ud->skillx, ud->skilly);
- unit_stop_walking(src,1);
+ if (ud->walktimer != -1)
+ unit_stop_walking(src,1);
ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv);
if ( battle_config.display_status_timers && sd )
clif_status_change(src, SI_ACTIONDELAY, 1, skill_delayfix(src, ud->skillid, ud->skilllv));
@@ -7707,7 +7708,7 @@ static int skill_unit_effect (struct block_list* bl, va_list ap)
int skill_id;
bool dissonance;
- if( !unit->alive || bl->prev == NULL )
+ if( (!unit->alive && !(flag&4)) || bl->prev == NULL )
return 0;
nullpo_retr(0, group);
@@ -9751,6 +9752,8 @@ int skill_delunit (struct skill_unit* unit)
nullpo_retr(0, unit);
if( !unit->alive )
return 0;
+ unit->alive=0;
+
nullpo_retr(0, group=unit->group);
if( group->state.song_dance&0x1 ) //Cancel dissonance effect.
@@ -9784,7 +9787,6 @@ int skill_delunit (struct skill_unit* unit)
clif_skill_delunit(unit);
unit->group=NULL;
- unit->alive=0;
map_delblock(&unit->bl); // don't free yet
map_deliddb(&unit->bl);
idb_remove(skillunit_db, unit->bl.id);