Skip to content

Commit

Permalink
21: fix rng not being random on new plays
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Aug 26, 2023
1 parent b205110 commit 1102170
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compat/game21/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function public.start(pack_id, level_id, level_options)
game.music.source:play()
end

game.rng.set_seed(game.input.next_seed(game.rng.get_seed()))
game.rng.set_seed(game.input.next_seed(seed))

game.main_timeline:clear()
game.event_timeline:clear()
Expand Down
25 changes: 13 additions & 12 deletions compat/game21/pseudo3d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,21 @@ function pseudo3d.apply_skew()
end
end

local function adjust_alpha(a, i)
if game.style.pseudo_3D_alpha_mult == 0 then
return a
end
local new_alpha = (a / game.style.pseudo_3D_alpha_mult) - i * game.style.pseudo_3D_alpha_falloff
if new_alpha > 255 then
return 255
elseif new_alpha < 0 then
return 0
end
return new_alpha
end

function pseudo3d.draw(set_render_stage, wall_quads, pivot_quads, player_tris, black_and_white)
if game.config.get("3D_enabled") then
local function adjust_alpha(a, i)
if game.style.pseudo_3D_alpha_mult == 0 then
return a
end
local new_alpha = (a / game.style.pseudo_3D_alpha_mult) - i * game.style.pseudo_3D_alpha_falloff
if new_alpha > 255 then
return 255
elseif new_alpha < 0 then
return 0
end
return new_alpha
end
for j = 1, depth do
local i = depth - j
local offset = game.style.pseudo_3D_spacing
Expand Down

0 comments on commit 1102170

Please sign in to comment.