Browse Source

Fix a crash in "core.wallmounted_to_dir"

master
OldCoder 2 months ago
parent
commit
101a1e5203
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      builtin/game/item.lua

+ 5
- 1
builtin/game/item.lua View File

@@ -143,8 +143,12 @@ local wallmounted_to_dir = {
{x = 0, y = 0, z = 1},
{x = 0, y = 0, z = -1},
}

function core.wallmounted_to_dir(wallmounted)
return wallmounted_to_dir[wallmounted % 8]
if wallmounted == nil then return nil end
wallmounted = tonumber (wallmounted)
if wallmounted == nil then return nil end
return wallmounted_to_dir [wallmounted % 8]
end

function core.dir_to_yaw(dir)


Loading…
Cancel
Save