mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 08:01:22 +00:00
improved model detection method
This commit is contained in:
parent
c77ef0cc9e
commit
bc70213972
1 changed files with 9 additions and 5 deletions
14
init.lua
14
init.lua
|
@ -115,18 +115,22 @@ end
|
|||
--returns 0 for old, 1 for new
|
||||
function airutils.detect_player_api(player)
|
||||
local player_proterties = player:get_properties()
|
||||
local mesh = "character.b3d"
|
||||
if player_proterties.mesh == mesh or player_proterties.mesh == "max.b3d" then
|
||||
--local mesh = "character.b3d"
|
||||
--if player_proterties.mesh == mesh then
|
||||
local models = player_api.registered_models
|
||||
local character = models[mesh]
|
||||
local character = models[player_proterties.mesh]
|
||||
if character then
|
||||
if character.animations.sit.eye_height then
|
||||
return 1
|
||||
if character.animations.sit.eye_height == 0.8 then
|
||||
--minetest.chat_send_all("new model");
|
||||
return 1
|
||||
end
|
||||
else
|
||||
--minetest.chat_send_all("old model");
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
--end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue