forked from LizzyFleckenstein03/Memeclone
Fix undeclared global fail in villager.lua
This commit is contained in:
parent
a6bb31f2a6
commit
2bb8b2c4e2
|
@ -653,13 +653,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
return_fields(player)
|
return_fields(player)
|
||||||
player_tradenum[player:get_player_name()] = nil
|
player_tradenum[name] = nil
|
||||||
local trader = player_trading_with[name]
|
local trader = player_trading_with[name]
|
||||||
if trader then
|
if trader then
|
||||||
trader._trading_players[name] = nil
|
trader._trading_players[name] = nil
|
||||||
end
|
end
|
||||||
player_trading_with[player:get_player_name()] = nil
|
player_trading_with[name] = nil
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue