Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2011, 03:16 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default IsPureNukeSpell issue?

I have been looking into this function while working on bots. Is this intended to allow heal spells through? The current code is below.

Code:
bool IsPureNukeSpell(int16 spell_id)
{
        int i, effect_count = 0;

        if(!IsValidSpell(spell_id))
                return false;

        for(i = 0; i < EFFECT_COUNT; i++)
        {
                if(!IsBlankSpellEffect(spell_id, i))
                        effect_count++;
        }

        return
        (
                effect_count == 1 && IsEffectInSpell(spell_id, SE_CurrentHP) && 
                spells[spell_id].buffduration == 0
        );
}
This will return true for any single effect heal, as it does not check for negative values (damage spells). To do some testing, I have added && IsDamageSpell(spellid) in the return after checking the buffduration, which has a lot of redundant code, but you can't really just do a quick && spells[spell_id].base[0] < 0, since I guess you can't be guaranteed that even though it has only 1 effect, that it is in slot 0. Instead of rewriting what's already there in IsDamageSpell, I would just use it..

Or is this working as intended?

I can use IsDamageSpell in what I'm working on for bots in conjunction with this, or it could be added here, if there isn't a reason for needing heals to be run through this. (This is called from IsPartialCapableSpell)
Reply With Quote
  #2  
Old 01-20-2011, 12:25 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

I vaguely recall this issue coming up before. I thought a negative value check had been added in to the test already.

In any case, I'd take a peek through where it is used to make sure it won't break anything (it shouldn't, but then I have been surprised before) and then I would add the negative value check. Or alternatively, check that the spell is detrimental.
Reply With Quote
  #3  
Old 01-20-2011, 01:24 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

For the bot code I am submitting, I just did a check for this as well as being a damage spell (I could have used IsDetrimental, but IsDamage seemed like less code for speed), since I wasn't sure if it would break anything. Just thought I'd point this out when I noticed it.

I know something similar was changed when the bot clerics would heal mobs and was fixed, but the same issue currently occurs for hybrids who are healing mobs. Anyway, I am submitting fixed bot code that works around this to make sure nothing outside of bots are affected.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:51 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3