34a2562964
This gets rid of the 5.4+ "deprecated get_player_velocity" warning and modernizes the code to use get_velocity() everywhere, while still remaining compatible with 5.3 for now (tested). The polyfill had to be on joinplayer because the nc_player_pickup auto-one-time method of using after() won't reliably patch the player before some other globalstep tries to read player velocity. When MT 5.5 is released and 5.3 support ends, the polyfill just needs to be removed to clean it up. Also tidied up and consistentized the logging for other hooks.
13 lines
370 B
Lua
13 lines
370 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local nodecore
|
|
= nodecore
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
nodecore.register_playerstep({
|
|
label = "terminal velocity",
|
|
action = function(player, data)
|
|
data.physics.gravity = nodecore.grav_air_physics_player(
|
|
player:get_velocity())
|
|
end
|
|
})
|