Browse Source

fixes, and now bones writes to log instead of just printing to console

master
poikilos 8 years ago
committed by Jacob Gustafson
parent
commit
e206cb74be
  1. 13
      README.md
  2. 9
      games/ENLIVEN/mods/bones/init.lua
  3. 5
      games/ENLIVEN/mods/protector/init.lua

13
README.md

@ -37,13 +37,24 @@ Otherwise just install everything EXCEPT cme_to_spawners & tsm_pyramids_to_spawn
## Changes:
* (2017-02-15) (change homedecor_modpack/homedecor) Add optional non-adult beverage version of homedecor in homedecor_modpack (just changes display name & variable name of Wine rack and Beer tap and beer mug, and textures for beer mug)
* (2017-02-22) Fix protector crash (also sent to TenPlus1):
```lua
if player and player:is_player() and player:get_hp() > 0 then -- ADDED THIS LINE
-- hurt player if protection violated
-- (a bunch of code is here for processing violations) --
end -- ADDED THIS LINE
return true
```
* (2017-02-22) NOTE: the protector fix below was merged by TenPlus1 today
* (2017-02-15) (change protector) Avoid crash by not allowing non-player to dig protected area (may only happen when one of the owners of an area does it--that was the crash scenario)
changed
return protector.can_dig(1, pos, player:get_player_name(), true, 1)
to
return player and protector.can_dig(1, pos, player:get_player_name(), true, 1) or false
* (2017-02-15) (change homedecor_modpack/homedecor) Add optional non-adult beverage version of homedecor in homedecor_modpack (just changes display name & variable name of Wine rack and Beer tap and beer mug, and textures for beer mug)
* (2017-02-15) (change bones) Show player (and print to server console) where died (and say bones remain or why not) -- with this addition, you can search your server log for "player's bones" where player is playername whether bones remain or not.
* (2017-02-14) (change mobs) Added some nonviolent textures that could be used in a school to the ENLIVEN/mods folder (they can be manually installed after ENLIVEN by copying them to the same place in your games/ENLIVEN folder on your installation of Minetest)
* (2017-02-06) Added installation of trmp_minetest_game to the installer script, since treasurer requires one or more trms in order to work (tested and working now on tsm_railcorridors)

9
games/ENLIVEN/mods/bones/init.lua

@ -169,7 +169,7 @@ minetest.register_on_dieplayer(function(player)
local pos = vector.round(player:getpos())
-- return if keep inventory set or in creative mode
if bones_mode == "keep" or minetest.setting_getbool("creative_mode") then
print(player:get_player_name() .. "'s bones do not remain since in creative_mode -- died at " .. minetest.pos_to_string(vector.round(player:getpos())))
minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones do not remain since in creative_mode -- died at " .. minetest.pos_to_string(vector.round(player:getpos())))
minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s bones do not remain since in creative_mode -- died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos)
return
end
@ -177,7 +177,7 @@ minetest.register_on_dieplayer(function(player)
local player_inv = player:get_inventory()
if player_inv:is_empty("main") and
player_inv:is_empty("craft") then
print(player:get_player_name() .. "'s bones do not remain since inventory and craft are empty -- died at " .. minetest.pos_to_string(vector.round(player:getpos())))
minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones do not remain since inventory and craft are empty -- died at " .. minetest.pos_to_string(vector.round(player:getpos())))
minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s bones do not remain since inventory and craft are empty -- died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos)
return
end
@ -210,14 +210,15 @@ minetest.register_on_dieplayer(function(player)
player_inv:set_list("craft", {})
drop(pos, ItemStack("bones:bones"))
print(player:get_player_name() .. "'s bones do not remain since area is_protected -- died at " .. minetest.pos_to_string(pos))
minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones do not remain since area is_protected -- died at " .. minetest.pos_to_string(pos))
minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s do not remain since area is_protected -- died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos)
return
end
local param2 = minetest.dir_to_facedir(player:get_look_dir())
minetest.set_node(pos, {name = "bones:bones", param2 = param2})
print(player:get_player_name() .. "'s bones remain where died at " .. minetest.pos_to_string(pos))
minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones remain where died at " .. minetest.pos_to_string(pos))
minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s bones remain where died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos)
local meta = minetest.get_meta(pos)

5
games/ENLIVEN/mods/protector/init.lua

@ -270,9 +270,8 @@ function minetest.is_protected(pos, digger)
-- is area protected against digger?
if not protector.can_dig(protector.radius, pos, digger, false, 1) then
local player = minetest.get_player_by_name(digger)
if player and player:is_player() and player:get_hp() > 0 then -- ADDED THIS LINE
-- hurt player if protection violated
if protector.hurt > 0
and player then
@ -336,7 +335,7 @@ function minetest.is_protected(pos, digger)
end
end
end
return true
end

Loading…
Cancel
Save