Fixed Bag of crafting not working
This commit is contained in:
1 parent
ce1d868587
commit
a45ae75fd8
1 file changed
+11
-2
+11
-2
@@ -217,9 +217,18 @@ local recheckPickups = false
|
|||||||
local customRNGSeed = 0x77777770
|
local customRNGSeed = 0x77777770
|
||||||
local customRNGShift = {0,0,0}
|
local customRNGShift = {0,0,0}
|
||||||
|
|
||||||
|
local function RNGNext()
|
||||||
|
local num = customRNGSeed
|
||||||
|
num = num ~ ((num >> customRNGShift[1]) & 4294967295)
|
||||||
|
num = num ~ ((num << customRNGShift[2]) & 4294967295)
|
||||||
|
num = num ~ ((num >> customRNGShift[3]) & 4294967295)
|
||||||
|
customRNGSeed = num >> 0;
|
||||||
|
return customRNGSeed;
|
||||||
|
end
|
||||||
|
|
||||||
local function nextFloat()
|
local function nextFloat()
|
||||||
local multi = 2.3283061589829401E-10;
|
local multi = 2.3283061589829401E-10;
|
||||||
return EID:RNGNext(customRNGSeed, customRNGShift[1], customRNGShift[2], customRNGShift[3]) * multi;
|
return RNGNext() * multi;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Convert a pickup's ID into what ingredient it counts as
|
-- Convert a pickup's ID into what ingredient it counts as
|
||||||
@@ -378,7 +387,7 @@ function EID:calculateBagOfCrafting(componentsTable)
|
|||||||
compCounts[compId + 1] = compCounts[compId + 1] + 1
|
compCounts[compId + 1] = compCounts[compId + 1] + 1
|
||||||
compTotalWeight = compTotalWeight + pickupValues[compId + 1]
|
compTotalWeight = compTotalWeight + pickupValues[compId + 1]
|
||||||
customRNGShift = componentShifts[compId + 1]
|
customRNGShift = componentShifts[compId + 1]
|
||||||
EID:RNGNext(customRNGSeed, customRNGShift[1], customRNGShift[2], customRNGShift[3])
|
RNGNext()
|
||||||
end
|
end
|
||||||
customRNGShift = componentShifts[7]
|
customRNGShift = componentShifts[7]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user