Fixed a heavy trade issue when item_stock is nil

master
Solebull 2019-02-26 03:12:59 +01:00
parent 0cb5e4771e
commit 955ab165ca
4 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2019-02-26 Solebull <solebull42@gmail.com>
* mods/villagers/trading.lua (villagers.getTradingFormspec): fix a
heavy bug with some villagers where item_stock is nil. Set it
to 1 by default.
2018-09-10 Solebull <solebull42@gmail.com>
* mods/beds/yellow.lua (register_bed): fix wield image.

View File

@ -261,12 +261,14 @@ It's really fast. May be used on a website, to show the actual map.
- see https://github.com/chipgw/minetest-mumble-wrapper
**** Some crashes
CLOCK: [2019-02-26 mar. 02:42]--[2019-02-26 mar. 03:02] => 0:20
CLOCK: [2019-02-24 dim. 22:03]--[2019-02-24 dim. 22:37] => 0:34
- [X] Try connected_chest mod Doesn't work
- [X] Trade error (set to 1)
- [ ] 2019-01-15 17:35:29: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '*builtin*' in callback luaentity_Step(): ...netest/games/minetest-pvp/mods/xpro/metodos/dig_node.lua:21: attempt to index local 'digger' (a nil value)
2019-01-15 17:35:29: ERROR[Main]: stack traceback:
2019-01-15 17:35:29: ERROR[Main]: ...netest/games/minetest-pvp/mods/xpro/metodos/dig_node.lua:21: in function 'callback'
2019-01-15 17:35:29: ERROR[Main]: /usr/local/share/minetest/builtin/game/falling.lua:103: in function </usr/local/share/minetest/builtin/game/falling.lua:53>
stack traceback:
netest/games/minetest-pvp/mods/xpro/metodos/dig_node.lua:21: in function 'callback'
usr/local/share/minetest/builtin/game/falling.lua:103: in function </usr/local/share/minetest/builtin/game/falling.lua:53>
**** DONE Another server fails
*These ones are important : the game is broken*

1
TODO
View File

@ -11,6 +11,7 @@ minetest-solebull - LGPL-2.1 - A PVP/faction game for minetest based on Cobalt.
* v0.0.2-5 (02 Jan. 2019 - ???) CLOC ???,???
- Fixed a heavy trade issue when item_stock is nil
- Add connected chest mod
- Fix a bug in Xpro making the game crash when xp_atual is nil
- Add more mc mobs with XPs

View File

@ -753,6 +753,11 @@ function villagers.getTradingFormspec(self, player_name)
inv_quant = inv_quant + stack_count
end
end
-- Try to fix a heavy bug when some values are nil
if item_stock == nil then
item_stock = 1
end
local ypos = (item_index-0.4) + ((item_index-1)*height_between_rows)
formspec = formspec..