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
|
||||
action.action = function(...)
|
||||
if(reflecting)then
|
||||
if reflecting then
|
||||
func(...)
|
||||
return
|
||||
end
|
||||
|
@ -15,13 +15,12 @@ for i=#actions,1,-1 do
|
|||
local shooter = EntityGetRootEntity(GetUpdatedEntityID())
|
||||
local x, y = EntityGetTransform(GetUpdatedEntityID())
|
||||
|
||||
local seed = x * y + GameGetFrameNum()
|
||||
local seed = math.floor(x * y + GameGetFrameNum())
|
||||
|
||||
if(EntityHasTag(shooter, "ew_client"))then
|
||||
--GamePrint("2: shooter_rng_"..EntityGetName(shooter))
|
||||
if EntityHasTag(shooter, "ew_client") then
|
||||
seed = tonumber(GlobalsGetValue("ew_action_rng_"..EntityGetName(shooter), "0")) or 0
|
||||
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"))
|
||||
else
|
||||
GlobalsSetValue("ew_player_action_rng", tostring(seed))
|
||||
|
@ -34,8 +33,6 @@ for i=#actions,1,-1 do
|
|||
|
||||
func(...)
|
||||
|
||||
|
||||
|
||||
SetRandomSeed = oldSetRandomSeed
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue