Compare commits

...

4 Commits

Author SHA1 Message Date
Zweihorn 25e71fe3ca
copy from intllib 2019-05-10 12:46:39 +02:00
Zweihorn b1ec85d8ef
fork of the stable-5 branch for game_intllib
This is a fork of the 5.0.1 version i.e. stable-5 branch for the limited purpose of the game_intllib project. This project is aiming at LUA-code translation in compliance to the GNU gettext toolchain and intentionally has the limited scope of a 'one-lamguage' server solution. This means the server 'language=' settings chooses one main language and both the translation of S(string") tags in the LUA-code is server driven.
2019-05-10 12:43:10 +02:00
Paramat 8678265125 Dungeon loot: Avoid empty 'if' branch to satisfy lua check 2019-03-31 22:26:33 +02:00
sfan5 df387e2394 Dungeon loot: Don't crash on unknown items
fixes #2228
2019-03-31 22:26:32 +02:00
3 changed files with 39 additions and 12 deletions

View File

@ -15,7 +15,7 @@ The Minetest Game github master HEAD is generally compatible with the github
master HEAD of the Minetest engine.
Additionally, when the Minetest engine is tagged to be a certain version (eg.
0.4.10), Minetest Game is tagged with the version too.
5.0.1), Minetest Game is tagged with the version too.
When stable releases are made, Minetest Game is packaged and made available in
http://minetest.net/downloads/

View File

@ -88,18 +88,20 @@ local function populate_chest(pos, rand, dungeontype)
amount = rand:next(loot.count[1], loot.count[2])
end
if itemdef.tool_capabilities then
for n = 1, amount do
local wear = rand:next(0.20 * 65535, 0.75 * 65535) -- 20% to 75% wear
table.insert(items, ItemStack({name = loot.name, wear = wear}))
if itemdef then
if itemdef.tool_capabilities then
for n = 1, amount do
local wear = rand:next(0.20 * 65535, 0.75 * 65535) -- 20% to 75% wear
table.insert(items, ItemStack({name = loot.name, wear = wear}))
end
elseif itemdef.stack_max == 1 then
-- not stackable, add separately
for n = 1, amount do
table.insert(items, loot.name)
end
else
table.insert(items, ItemStack({name = loot.name, count = amount}))
end
elseif itemdef.stack_max == 1 then
-- not stackable, add separately
for n = 1, amount do
table.insert(items, loot.name)
end
else
table.insert(items, ItemStack({name = loot.name, count = amount}))
end
end
end

View File

@ -0,0 +1,25 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>