Issue information

Issue ID
#707
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Dec 29, 2007 1:14
Last Post
Hercules Elf Bot
Dec 29, 2007 1:14
Confirmation
N/A

Hercules Elf Bot - Dec 29, 2007 1:14

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=707

Could someone suggest a way to clean up the waterball code?
Currently there are some calculations scattered around skill.c, various exceptions placed in weird locations,
and the code that initiates the waterball should be rewritten...
CODE
    case WZ_WATERBALL:            /* ウă‚Â©ăƒĽă‚żăƒĽăƒśăƒĽăƒÂ« */
        skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
        if (skilllv>1) {
            int range = skilllv/2;
            int cnt;
              if (sd)
                cnt = skill_count_water(src,range);
            else {
                range = 2*range+1;
                cnt = range*range;
            }
            cnt--;
            if (cnt > 0)
                skill_addtimerskill(src,tick+125,bl->id,0,0,skillid,skilllv,cnt,flag);
        } else if (sd) //Eat up deluge tiles.
            skill_count_water(src,0);

        break;
I suggest getting rid of that if-else thing, then inlining the skill_count_water() function (because it not only counts, it also deletes (IMG:style_emoticons/default/sleep.gif)).

PS: some notable revisions are r3945 and 6710 - stuff that doesn't make much sense to me.

This post has been edited by theultramage: Dec 28 2007, 05:16 PM