Allow 45 degree "throw" turns

If the player is on a 90 degree cardinal, and they hit a
turn but the blocking wall is "incomplete", then turn
only 45 degrees instead; using a longer wall will guide
the player into the full 90 degree turn.

Note that we will still need a 45 degree "catch" turn, to
turn a player running at 45 degrees back into a 90 degree
moving player.
This commit is contained in:
Aaron Suen 2023-11-28 18:17:15 -05:00
parent e9b0d28726
commit 468d5076aa

View File

@ -128,7 +128,8 @@ local function turncheck(player, pos, fwd, theta)
vector.multiply(fwd, f)),
vector.multiply(turn, t))
end
if isfloor(rel(0, 1)) and iswall(rel(0, -1)) and iswall(rel(-1, 1)) then
if isfloor(rel(0, 1)) and iswall(rel(0, -1)) then
if not iswall(rel(-1, 1)) then theta = theta / 2 end
player:set_look_horizontal(math_floor(player:get_look_horizontal()
/ hpi + 0.5) * hpi + theta)
return true