Skip to content

Commit

Permalink
try to ensure that a bones node was actually placed
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxionary committed Jan 23, 2024
1 parent 6090732 commit 77f1cc7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .check_date.sh
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
grep $(date -u -I) mod.conf
exit $?
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -17,6 +17,13 @@ repos:
pass_filenames: true
exclude: .pre-commit-config.yaml
fail_fast: true
- id: date_version
name: date version
language: script
entry: .check_date.sh
files: mod.conf
always_run: true
fail_fast: true
- id: stylua
name: stylua
language: system
Expand Down
6 changes: 6 additions & 0 deletions api.lua
Expand Up @@ -219,6 +219,12 @@ function api.place_bones_node(player, bones_pos, stacks_for_bones)
param2 = minetest.dir_to_facedir(player:get_look_dir()),
})

-- i've encountered a place where the air node where the bones should have been placed was still air, and the
-- items were in that air node's metadata... hopefully this check will prevent that:
if minetest.get_node(bones_pos).name ~= "bones:bones" then
return false
end

local node_meta = minetest.get_meta(bones_pos)
local node_inv = node_meta:get_inventory()
node_inv:set_size("main", #stacks_for_bones)
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Expand Up @@ -5,7 +5,7 @@ website = https://content.minetest.net/packages/rheo/bones/
author = fluxionary
license = LGPL-3.0-or-later
media_license = CC-BY-SA-4.0
version = 2023-01-29
version = 2024-01-23
min_minetest_version = 5.7.0
supported_games = *
depends = fmod, futil
Expand Down

0 comments on commit 77f1cc7

Please sign in to comment.