Starfinder Playlist
  1. #1
    celestian's Avatar
    Join Date
    Jan 2017
    Location
    DFW, Texas
    Posts
    2,710

    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).
    ---
    Coding the Official AD&D Ruleset
    Documentation for AD&D 2E ruleset.
    My Twitch Channel for AD&D and FG related streams (See schedule for live days)
    My YouTube for FG related Tutorials and AD&D Actual Plays
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    26,493
    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.
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    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
    celestian's Avatar
    Join Date
    Jan 2017
    Location
    DFW, Texas
    Posts
    2,710
    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.
    ---
    Coding the Official AD&D Ruleset
    Documentation for AD&D 2E ruleset.
    My Twitch Channel for AD&D and FG related streams (See schedule for live days)
    My YouTube for FG related Tutorials and AD&D Actual Plays
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
PF2E Playlist

Log in

Log in