mirror of
https://github.com/APercy/automobiles_pck
synced 2025-09-24 12:06:23 +02:00
improved model detection method
This commit is contained in:
parent
772bfd0575
commit
8608f6651d
@ -51,16 +51,17 @@ end
|
|||||||
--returns 0 for old, 1 for new
|
--returns 0 for old, 1 for new
|
||||||
function automobiles_lib.detect_player_api(player)
|
function automobiles_lib.detect_player_api(player)
|
||||||
local player_proterties = player:get_properties()
|
local player_proterties = player:get_properties()
|
||||||
local mesh = "character.b3d"
|
local models = player_api.registered_models
|
||||||
if player_proterties.mesh == mesh or player_proterties.mesh == "max.b3d" then
|
local character = models[player_proterties.mesh]
|
||||||
local models = player_api.registered_models
|
if character then
|
||||||
local character = models[mesh]
|
if character.animations.sit.eye_height then
|
||||||
if character then
|
if character.animations.sit.eye_height == 0.8 then
|
||||||
if character.animations.sit.eye_height then
|
--minetest.chat_send_all("new model");
|
||||||
return 1
|
return 1
|
||||||
else
|
|
||||||
return 0
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
--minetest.chat_send_all("old model");
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user