1
0
鏡像自 https://github.com/luanti-org/minetest_game.git 已同步 2025-11-01 15:55:28 +01:00

Books: Add nil value checks to the book formspec handler

此提交包含在:
red-001
2017-06-13 23:59:25 +01:00
提交者 paramat
父節點 175a9f8ff5
當前提交 da7e8e4810

查看文件

@@ -80,7 +80,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local inv = player:get_inventory()
local stack = player:get_wielded_item()
if fields.save and fields.title ~= "" and fields.text ~= "" then
if fields.save and fields.title and fields.text
and fields.title ~= "" and fields.text ~= "" then
local new_stack, data
if stack:get_name() ~= "default:book_written" then
local count = stack:get_count()