mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
add vc.is_headless, vc.is_client
This commit is contained in:
parent
ded3dd2046
commit
678e5db03d
6 changed files with 19 additions and 6 deletions
|
|
@ -80,7 +80,7 @@ function on_physics_update(delta)
|
|||
local front = mat4.mul(rot, {0, 0, -1})
|
||||
local pos = tsf:get_pos()
|
||||
|
||||
if not VC_HEADLESS and pid == hud.get_player() then
|
||||
if vc.is_client() and pid == hud.get_player() then
|
||||
process_player_inputs(pid, rot, delta)
|
||||
end
|
||||
mob.look_at(vec3.add(pos, front))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,18 @@
|
|||
local _vc_headless = __VC_HEADLESS
|
||||
__VC_HEADLESS = nil
|
||||
|
||||
vc = {
|
||||
is_headless = function()
|
||||
return _vc_headless
|
||||
end,
|
||||
is_client = function ()
|
||||
return not _vc_headless
|
||||
end
|
||||
}
|
||||
|
||||
local _ffi = ffi
|
||||
local _debug_getinfo = debug.getinfo
|
||||
local _crc32 = crc32
|
||||
|
||||
function crc32(bytes, chksum)
|
||||
chksum = chksum or 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue