Skip to content

Commit

Permalink
Use mod.conf for dependencies, and description (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panquesito7 authored and SmallJoker committed Oct 17, 2019
1 parent 26e9a32 commit b51cd03
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 0 additions & 2 deletions depends.txt

This file was deleted.

1 change: 0 additions & 1 deletion description.txt

This file was deleted.

16 changes: 8 additions & 8 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local function freeze(player)
else
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
end
default.player_attached[player_name] = true
player_api.player_attached[player_name] = true
end

local function unfreeze(player)
Expand All @@ -21,8 +21,8 @@ local function unfreeze(player)
else
player:set_physics_override({speed = 1, jump = 1, gravity = 1})
end
default.player_attached[player_name] = nil
default.player_set_animation(player, "stand", 30)
player_api.player_attached[player_name] = nil
player_api.set_animation(player, "stand", 30)
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
end

Expand All @@ -32,7 +32,7 @@ minetest.register_globalstep(function(dtime)
local player = players[i]
local name = player:get_player_name()
local control = player:get_player_control()
if default.player_attached[name] and not player:get_attach() and (
if player_api.player_attached[name] and not player:get_attach() and (
control.up == true or
control.down == true or
control.left == true or
Expand All @@ -48,11 +48,11 @@ minetest.register_chatcommand("sit", {
description = "Sit down",
func = function(name)
local player = minetest.get_player_by_name(name)
if default.player_attached[name] then
if player_api.player_attached[name] then
unfreeze(player)
else
freeze(player)
default.player_set_animation(player, "sit", 30)
player_api.set_animation(player, "sit", 30)
player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
end
end
Expand All @@ -62,11 +62,11 @@ minetest.register_chatcommand("lay", {
description = "Lay down",
func = function(name)
local player = minetest.get_player_by_name(name)
if default.player_attached[name] then
if player_api.player_attached[name] then
unfreeze(player)
else
freeze(player)
default.player_set_animation(player, "lay", 0)
player_api.set_animation(player, "lay", 0)
player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
end
end
Expand Down
3 changes: 3 additions & 0 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
name = cozy
depends = default, player_api
optional_depends = player_monoids
description = Adds sitting down, and lying down player animations.

0 comments on commit b51cd03

Please sign in to comment.