LibFail-1.0

29 - Fails firing when they shouldn't

Still numerous fails that fire the INSTANT a spell is cast, not after x amount of time like intended design.

one such example is

    -- Lady Deathwhisper - Death and Decay
    if (spellId == 71001 or spellId == 72108 or spellId == 72109 or spellId == 72110) and is_playerevent then
        if self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName] ~= nil then
            if (timestamp - self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName]) > 4 then
                self:FailEvent("Fail_Deathwhisper_DeathNDecay", destName, self.FAIL_TYPE_NOTMOVING)
            end
        end

        self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName] = timestamp

        return
    end

The very instant she throws death and decay down, veryone in it is failled instantly, not after 4 seconds of standing in it..My interpretation is the code is working fine, the way the fail is writen is wrong...All the code says to do is if timestamp >4 for last time event happened to fail person...so if it's second time she casts death and decay that fight, isn't it >4 so it'll fail everyone right away anyways since it was timestamped the last time she cast it at the end instead of beginning?

Wouldn't this be more sound?

    -- Lady Deathwhisper - Death and Decay
    if (spellId == 71001 or spellId == 72108 or spellId == 72109 or spellId == 72110) and is_playerevent then
        if self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName] ~= nil then
        self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName] = timestamp
            if (timestamp - self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName]) > 3 then
                self:FailEvent("Fail_Deathwhisper_DeathNDecay", destName, self.FAIL_TYPE_NOTMOVING)
            end
        end
        return
    end

a fail should not happen simply because she cast it on you twice in a fight so it'll just fail you instantly second time since you time stamp it a end of code first time event happened. Numerous fails have this flaw and need to be rewriten to be handled better.

User When Change
mysticalos May 13, 2010 at 19:17 UTC Changed status from Replied to Waiting
mysticalos May 11, 2010 at 21:02 UTC Changed status from Waiting to Replied
mysticalos May 08, 2010 at 22:45 UTC Changed status from Accepted to Waiting
mysticalos May 08, 2010 at 22:45 UTC Changed status from Accepted to Waiting
mysticalos Feb 16, 2010 at 21:27 UTC Changed assigned to from None to mysticalos
mysticalos Feb 16, 2010 at 21:27 UTC Changed status from Replied to Accepted
mysticalos Feb 13, 2010 at 21:20 UTC Changed status from Waiting to Replied
mysticalos Feb 13, 2010 at 21:17 UTC Changed description:
  <<code lua>>
      -- Lady Deathwhisper - Death and Decay
      if (spellId == 71001 or spellId == 72108 or spellId == 72109 or spellId == 72110) and is_playerevent then
+         if self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName] ~= nil then
          self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName] = timestamp
              if (timestamp - self.LastEvent.Fail_Deathwhisper_DeathNDecay[destName]) > 3 then
                  self:FailEvent("Fail_Deathwhisper_DeathNDecay", destName, self.FAIL_TYPE_NOTMOVING)
mysticalos Feb 13, 2010 at 21:12 UTC Changed description:
  The very instant she throws death and decay down, veryone in it is failled instantly, not after 4 seconds of standing in it..My interpretation is the code is working fine, the way the fail is writen is wrong...All the code says to do is if timestamp >4 for last time event happened to fail person...so if it's second time she casts death and decay that fight, isn't it >4 so it'll fail everyone right away anyways since it was timestamped the last time she cast it at the end instead of beginning?

- Wouldn't this be more sound? a fail should not simply because she cast it on you twice in a fight so it'll just fail you instantly second time since you time stamp it a end of code first time event happened. Numerous fails have this flaw and need to be rewriten to be handled better.
+ Wouldn't this be more sound?
  <<code lua>>
      -- Lady Deathwhisper - Death and Decay
      if (spellId == 71001 or spellId == 72108 or spellId == 72109 or spellId == 72110) and is_playerevent then
----------------------------------------
          return
      end
  <</code>>
+  a fail should not happen simply because she cast it on you twice in a fight so it'll just fail you instantly second time since you time stamp it a end of code first time event happened. Numerous fails have this flaw and need to be rewriten to be handled better.
mysticalos Feb 13, 2010 at 21:11 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 4 comments
  • Avatar of mysticalos mysticalos May 12, 2010 at 05:59 UTC - 0 likes

    so far the new checks seem to be working now. need to test more fights to be sure

  • Avatar of mysticalos mysticalos May 11, 2010 at 21:02 UTC - 0 likes

    none of the logics work not sure why

    Last edited May 11, 2010 by mysticalos
  • Avatar of mysticalos mysticalos May 08, 2010 at 22:45 UTC - 0 likes

    Commited a fix i think will work best. Changing to waiting until i can run more tests on it or get feedback.

  • Avatar of mysticalos mysticalos Feb 13, 2010 at 21:20 UTC - 0 likes

    or more writen like this

        -- Racorscale Flame
        if (spellId == 64733 or spellId == 64704) and is_playerevent then
            if self.LastEvent.Fail_Racorscale_Flame[destName] == nil then
               self.LastEvent.Fail_Racorscale_Flame[destName] = 0
            end
    
            self.LastEvent.Fail_Racorscale_Flame[destName] = self.LastEvent.Fail_Racorscale_Flame[destName] + 1
    
            if self.LastEvent.Fail_Racorscale_Flame[destName] == 2 then
               self:FailEvent("Fail_Racorscale_Flame", destName, self.FAIL_TYPE_NOTMOVING)
               self.LastEvent.Fail_Racorscale_Flame[destName] = 0
            end
    
            return
        end
    
  • 4 comments

Facts

Last updated
May 13, 2010
Reported
Feb 13, 2010
Status
Waiting - Waiting for more information.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees