Skip to content

Commit

Permalink
Fix load-time version check
Browse files Browse the repository at this point in the history
  • Loading branch information
LBPHacker committed Dec 27, 2022
1 parent 67da90e commit 9c41921
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tptmp/client/init.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
local common_util = require("tptmp.common.util")

local loadtime_error
local http = rawget(_G, "http")
local socket = rawget(_G, "socket")
if sim.CELL ~= 4 then -- * Required by cursor snapping functions.
loadtime_error = "CELL size is not 4"
elseif sim.PMAPBITS >= 13 then -- * Required by how non-element tools are encoded (extended tool IDs, XIDs).
loadtime_error = "PMAPBITS is too large"
elseif not (tpt.version and tpt.version.major >= 96 and tpt.version.minor >= 2) then
elseif not tpt.version or common_util.version_less({ tpt.version.major, tpt.version.minor }, { 96, 2 }) then
loadtime_error = "version not supported"
elseif not rawget(_G, "bit") then
loadtime_error = "no bit API"
Expand Down

0 comments on commit 9c41921

Please sign in to comment.