5E Character Create Playlist
  1. #1

    manager_effect.lua, processEffect() bug?

    Around line 189 I've noticed this.

    Code:
    local nEffInit = DB.getValue(nodeEffect, aEffectVarMap["nInit"].sDBField, aEffectVarMap["nInit"].vDBDefault or 0);
    The piece of code that caught my eye was aEffectVarMap["nInit"].vDBDefault, there is no "vDBDefault" defined for nInit, it is for "nDuration".

    I ran into an edge case that complained about an error on this line and noticed this (unrelated to my issue I think).
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,406
    Quote Originally Posted by celestian View Post
    Around line 189 I've noticed this.

    Code:
    local nEffInit = DB.getValue(nodeEffect, aEffectVarMap["nInit"].sDBField, aEffectVarMap["nInit"].vDBDefault or 0);
    The piece of code that caught my eye was aEffectVarMap["nInit"].vDBDefault, there is no "vDBDefault" defined for nInit, it is for "nDuration".
    I noticed that recently. But I imagine that is why there's the "or 0" at the end - if there isn't a default in aEffectVarMap then it will use 0. I think that line is generic code for a DB.getValue for a field defined in the aEffectVarMap table. In this case there isn't a vDBDefault value for "nInit" as standard - which is covered by the "or 0" in this case. But, some other code (an extension or layered ruleset) may set a default and if it does, then the vDBDefault will be used.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Quote Originally Posted by Trenloe View Post
    I noticed that recently. But I imagine that is why there's the "or 0" at the end - if there isn't a default in aEffectVarMap then it will use 0. I think that line is generic code for a DB.getValue for a field defined in the aEffectVarMap table. In this case there isn't a vDBDefault value for "nInit" as standard - which is covered by the "or 0" in this case. But, some other code (an extension or layered ruleset) may set a default and if it does, then the vDBDefault will be used.
    That was my thought and I checked 5E looking to see if they had but nothing was there that I found. Could be for another ruleset I suppose but I suspect it's more of a typo than intended.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

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
  •  
5E Product Walkthrough Playlist

Log in

Log in