mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
Fix having different seeds in gun actions.
This commit is contained in:
parent
766cfb6b91
commit
f657f811a5
1 changed files with 5 additions and 8 deletions
|
@ -5,7 +5,7 @@ for i=#actions,1,-1 do
|
||||||
|
|
||||||
local func = action.action
|
local func = action.action
|
||||||
action.action = function(...)
|
action.action = function(...)
|
||||||
if(reflecting)then
|
if reflecting then
|
||||||
func(...)
|
func(...)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -15,27 +15,24 @@ for i=#actions,1,-1 do
|
||||||
local shooter = EntityGetRootEntity(GetUpdatedEntityID())
|
local shooter = EntityGetRootEntity(GetUpdatedEntityID())
|
||||||
local x, y = EntityGetTransform(GetUpdatedEntityID())
|
local x, y = EntityGetTransform(GetUpdatedEntityID())
|
||||||
|
|
||||||
local seed = x * y + GameGetFrameNum()
|
local seed = math.floor(x * y + GameGetFrameNum())
|
||||||
|
|
||||||
if(EntityHasTag(shooter, "ew_client"))then
|
if EntityHasTag(shooter, "ew_client") then
|
||||||
--GamePrint("2: shooter_rng_"..EntityGetName(shooter))
|
|
||||||
seed = tonumber(GlobalsGetValue("ew_action_rng_"..EntityGetName(shooter), "0")) or 0
|
seed = tonumber(GlobalsGetValue("ew_action_rng_"..EntityGetName(shooter), "0")) or 0
|
||||||
else
|
else
|
||||||
if(GlobalsGetValue("ew_player_action_rng", "0") ~= "0")then
|
if GlobalsGetValue("ew_player_action_rng", "0") ~= "0" then
|
||||||
seed = tonumber(GlobalsGetValue("ew_player_action_rng", "0"))
|
seed = tonumber(GlobalsGetValue("ew_player_action_rng", "0"))
|
||||||
else
|
else
|
||||||
GlobalsSetValue("ew_player_action_rng", tostring(seed))
|
GlobalsSetValue("ew_player_action_rng", tostring(seed))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
SetRandomSeed = function()
|
SetRandomSeed = function()
|
||||||
oldSetRandomSeed(seed, seed)
|
oldSetRandomSeed(seed, seed)
|
||||||
end
|
end
|
||||||
|
|
||||||
func(...)
|
func(...)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SetRandomSeed = oldSetRandomSeed
|
SetRandomSeed = oldSetRandomSeed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue