Jump to content

Toinan67

Members
  • Posts

    389
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Toinan67

  1. void vutf8printf(FILE *out, const char *str, va_list* ap)
    {
    #if PLATFORM == PLATFORM_WINDOWS
       char temp_buf[32*1024];
       wchar_t wtemp_buf[32*1024];
    
       size_t temp_len = vsnprintf(temp_buf, 32*1024, str, *ap);
    
       size_t wtemp_len = 32*1024-1;
       Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len);
    
       CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1);
       fprintf(out, temp_buf);
    #else
       vfprintf(out, str, *ap);
    #endif
    }
    

    Windows-only bug :) (yeepee I'm using Debian!)

    Something wrong with temp_buf?

  2. Probably Michael Bay's next big project. I can see it now... lots of explosions, steam tonks with metal balls, two goblins acting like homeboys for comic relief, and Megan Fox not acting.

    ^_^

    I'd prefer a James Cameron's movie in 3D and beautiful images, with a poor dwarf community being exterminated by orcs.

  3. I was wrong, lavinelu is correct : problem is (I think) from RemoveAurasDueToSpellByCancel

    The aura is not removed

    void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId)
    {
       SpellAuraHolderBounds spair = GetSpellAuraHolderBounds(spellId);
       for(SpellAuraHolderMap::iterator iter = spair.first; iter != spair.second;)
       {
           RemoveSpellAuraHolder(iter->second, AURA_REMOVE_BY_CANCEL);
           spair = GetSpellAuraHolderBounds(spellId);
           iter = spair.first;
       }
    }
    

  4. lavinelu > I think it's not removed from slowingAuras

    itr is a reference to a const AuraList. So the list does not change... (or is it the reference which is const?)

    Haha I'm not sure anymore

    Help needed :)

    Dron01 > For sure it's slower but I don't see any other way for the moment

    And see the prototype of GetAurasByType :

    AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }

    You'll have an invalid conversion from AuraList const& to Auralist & or something like that

  5. Aura is removed, and that's the "problem" actually no?

    We have an instant crash, not a freeze/infinite loop (see The_Game_Master's crash logs)

    The aura is removed from the target but not from the slowingAuras list, then the iterator returns to slowingAuras.begin()

    And when we reach the aura we just removed...

    Fails here :

    SpellEntry const* aurSpellInfo = (*iter)->GetSpellProto();
    uint32 aurMechMask = GetAllSpellMechanicMask(aurSpellInfo);
    

    SpellMgr.h :

    inline uint32 GetAllSpellMechanicMask(SpellEntry const* spellInfo)
    {
       uint32 mask = 0;
       if (spellInfo->Mechanic)
           mask |= 1 << (spellInfo->Mechanic - 1);
       for (int i=0; i< 3; ++i)
           if (spellInfo->EffectMechanic[i])
               mask |= 1 << (spellInfo->EffectMechanic[i]-1);
       return mask;
    }
    

    ASSERT(spellInfo); would have been nice

    Am I totally wrong here? x)

  6.             
    -    Unit::AuraList const& slowingAuras = target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
    -    for (Unit::AuraList::const_iterator iter = slowingAuras.begin(); iter != slowingAuras.end()
    +    for (Unit::AuraList::const_iterator iter = target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED).begin(); iter != target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED).end()
       {
           SpellEntry const* aurSpellInfo = (*iter)->GetSpellProto();
    
           uint32 aurMechMask = GetAllSpellMechanicMask(aurSpellInfo);
    
           // If spell that caused this aura has Croud Control or Daze effect
           if((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
           // some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells)
           aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 &&
           (aurMechMask & (1 << (MECHANIC_SNARE-1)))==0)
           {
               ++iter;
               continue;
           }
    
           // All OK, remove aura now
           target->RemoveAurasDueToSpellByCancel(aurSpellInfo->Id);
    -        iter = slowingAuras.begin();
    +        iter = target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED).begin();             
       }
    

    Maybe?

  7. I think Dron01 is right.

    Maybe

    -    for (Unit::AuraList::const_iterator iter = slowingAuras.begin(); iter != slowingAuras.end()
    +    for (Unit::AuraList::const_iterator iter = target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED).begin(); iter != target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED).end()
    

  8. Actually I think they're not unrelated but they're clearly classified in a wrong way

    Seems like the "hot" threads (with a lot of posts but which doesn't match very much with the keywords) are more highlighted than others.

    The threads which match a lot with the keywords but have 2 or 3 posts aren't shown on the "top" of the results

  9. void Aura::HandleAuraModBaseResistancePCT(bool apply, bool /*Real*/)
    {
       // only players have base stats
       if(GetTarget()->GetTypeId() != TYPEID_PLAYER)
       {
           //pets only have base armor
           if(((Creature*)GetTarget())->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
               GetTarget()->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_modifier.m_amount), apply);
       }
       else
       {
           for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++)
           {
               if(m_modifier.m_miscvalue & int32(1<<x))
                   GetTarget()->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(m_modifier.m_amount), apply);
           }
       }
    }
    

    Something wrong here?

    Maybe with float(m_modifier.m_amount)?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use