5E Character Create Playlist
  1. #1

    5E ActionDamage.checkNumericalReductionType

    If checkNumericalReductionType is called and aReduction filter is "all" AND the damage roll has multiple damage types (aDmgType) this function will over reduce because it calls the checkNumericalReductionTypeHelper function with "all" for the number of aDmgType on the damage roll.

    I believe the following is what was intended.

    Code:
    function checkNumericalReductionType(aReduction, aDmgType, nLimit)
        local nAdjust = 0;
        local  nSpecificAdjust;
    	for _,sDmgType in pairs(aDmgType) do
    		if nLimit then
    			nSpecificAdjust = ActionDamage.checkNumericalReductionTypeHelper(aReduction[sDmgType], aDmgType, nLimit);
    			nAdjust = nAdjust + nSpecificAdjust;
    		else
    			nAdjust = nAdjust + ActionDamage.checkNumericalReductionTypeHelper(aReduction[sDmgType], aDmgType);
    		end
    	end
        if nLimit then
            local nGlobalAdjust = ActionDamage.checkNumericalReductionTypeHelper(aReduction["all"], aDmgType, nLimit - nSpecificAdjust);
            nAdjust = nAdjust + nGlobalAdjust;
        else
            nAdjust = nAdjust + ActionDamage.checkNumericalReductionTypeHelper(aReduction["all"], aDmgType);
        end
    
    	return nAdjust;
    end

  2. #2
    Thanks, I'll incorporate in the next big ruleset push.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in