summaryrefslogtreecommitdiff
path: root/triggers.lua
diff options
context:
space:
mode:
authorRubenwardy <anjayward@gmail.com>2013-11-12 19:33:19 +0000
committerRubenwardy <anjayward@gmail.com>2013-11-12 19:33:19 +0000
commit6387bd1d9e128c23bd47b1bbf0544362f8fdbfba (patch)
tree020b716219b88bf5809bb6cbc3ac1dced66437ce /triggers.lua
parent3a0bc67d1be20bfe1f856b5c7fbeaffbf2bc9887 (diff)
Fix playern variable bug
Diffstat (limited to 'triggers.lua')
-rw-r--r--triggers.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/triggers.lua b/triggers.lua
index b13ff93..0121768 100644
--- a/triggers.lua
+++ b/triggers.lua
@@ -140,6 +140,7 @@ minetest.register_on_dieplayer(function(player)
if not player or not player:get_player_name() or player:get_player_name()=="" then
return
end
+ local playern = player:get_player_name()
awards.tbv(awards.players, playern )
awards.tbv(awards.players[playern], "name", playern )
awards.tbv(awards.players[playern], "deaths", 0 )
@@ -148,7 +149,6 @@ minetest.register_on_dieplayer(function(player)
awards.players[player:get_player_name()].deaths = awards.players[player:get_player_name()].deaths + 1
-- Run callbacks and triggers
- local playern=player:get_player_name()
local data=awards.players[playern]
for i=1,# awards.onDeath do
local res=nil
@@ -179,8 +179,9 @@ minetest.register_on_dieplayer(function(player)
end)
minetest.register_on_newplayer(function(player)
- awards.tbv(awards.players, player:get_player_name())
- awards.tbv(awards.players[playern], "name", player:get_player_name())
+ local playern = player:get_player_name()
+ awards.tbv(awards.players, playern)
+ awards.tbv(awards.players[playern], "name", playern)
awards.tbv(awards.players[playern], "unlocked")
awards.tbv(awards.players[playern], "place")
awards.tbv(awards.players[playern], "count")