diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-02 23:21:54 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-02 23:21:54 +0000 |
commit | 57fbe69be8382e1f659dad2e7d9ae3ecc1c273d7 (patch) | |
tree | 2f8bb925301d675051b6b28da620bc94f4c16ffb /src/map | |
parent | 632c620f0acb0119bc7edf46ffb3b5301c4ebf1f (diff) | |
download | hercules-57fbe69be8382e1f659dad2e7d9ae3ecc1c273d7.tar.gz hercules-57fbe69be8382e1f659dad2e7d9ae3ecc1c273d7.tar.bz2 hercules-57fbe69be8382e1f659dad2e7d9ae3ecc1c273d7.tar.xz hercules-57fbe69be8382e1f659dad2e7d9ae3ecc1c273d7.zip |
- Fixed a logic error on battle_get_master which was causing infinite loops... ~.~
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8077 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 60f6a1f01..4a84744d1 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3085,29 +3085,29 @@ int battle_check_undead(int race,int element) //Returns the upmost level master starting with the given object static struct block_list* battle_get_master(struct block_list *src) { - struct block_list *mst; //Used for infinite loop check (master of yourself?) + struct block_list *prev; //Used for infinite loop check (master of yourself?) do { - mst = src; + prev = src; switch (src->type) { case BL_PET: if (((TBL_PET*)src)->msd) - mst = (struct block_list*)((TBL_PET*)src)->msd; + src = (struct block_list*)((TBL_PET*)src)->msd; break; case BL_MOB: if (((TBL_MOB*)src)->master_id) - mst = map_id2bl(((TBL_MOB*)src)->master_id); + src = map_id2bl(((TBL_MOB*)src)->master_id); break; case BL_HOMUNCULUS: if (((TBL_HOMUNCULUS*)src)->master) - mst = (struct block_list*)((TBL_HOMUNCULUS*)src)->master; + src = (struct block_list*)((TBL_HOMUNCULUS*)src)->master; break; case BL_SKILL: if (((TBL_SKILL*)src)->group && ((TBL_SKILL*)src)->group->src_id) - mst = map_id2bl(((TBL_SKILL*)src)->group->src_id); + src = map_id2bl(((TBL_SKILL*)src)->group->src_id); break; } - } while (mst && src != mst); - return src; + } while (src && src != prev); + return prev; } /*========================================== |