DICE PACKS BUNDLE

Thread: Fudge die bug?

  1. #1

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096

    Fudge die bug?

    As I'm working my extension, I ran across the following code in the manager_table.lua file in the function prepareTableDice:

    Code:
    					local nRandom = math.random(3);
    					if nRandom == 1 then
    						nResult = -1;
    					elseif nRandom == 3 then
    						nResult = 1;
    					end
    shouldn't that be:

    Code:
    					local nRandom = math.random(3);
    					if nRandom == 1 then
    						nResult = -1;
    					elseif nRandom == 3 then
    						nResult = 1;
                                            else
                                                    nResult=0;
    					end

  2. #2

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    nResult is unassigned, so it's interpreted as 0. Assigning it makes it explicit, but it's not needed.

  3. #3

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    You are absolutely correct. Right before the code I pasted is the line "local nResult;" which essentially sets it to zero.

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 Character Create Playlist

Log in

Log in