Thread: Fudge die bug?
-
January 14th, 2017, 15:55 #1
Archangel
- 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
Code:local nRandom = math.random(3); if nRandom == 1 then nResult = -1; elseif nRandom == 3 then nResult = 1; else nResult=0; end
-
January 14th, 2017, 17:07 #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.
-
January 14th, 2017, 17:11 #3
Archangel
- 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