1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-11 12:50:41 +01:00

fix crash si class on_update() not defined

fix wrong stamina value to hunter
remove old call of function, moved to assign api
This commit is contained in:
crabman77 2017-04-20 02:22:17 +02:00
parent c9b5199e97
commit 8d2683b94b
3 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,9 @@ pclasses.api.register_class("admin", {
end, end,
on_unassigned = function(pname) on_unassigned = function(pname)
end, end,
on_update = function(pname)
-- No specific armor changes, no code
end,
switch_params = { switch_params = {
color = {r = 255, g = 00, b = 224}, color = {r = 255, g = 00, b = 224},
holo_item = "maptools:pick_admin" holo_item = "maptools:pick_admin"

View File

@ -14,11 +14,11 @@ pclasses.api.register_class("hunter", {
minetest.chat_send_player(pname, "You are now a hunter") minetest.chat_send_player(pname, "You are now a hunter")
minetest.sound_play("pclasses_full_hunter", {to_player=pname, gain=1}) minetest.sound_play("pclasses_full_hunter", {to_player=pname, gain=1})
end end
sprint.increase_maxstamina(pname, 10) sprint.increase_maxstamina(pname, 20)
minetest.log("action", "[PClasses] Player " .. pname .. " become a hunter") minetest.log("action", "[PClasses] Player " .. pname .. " become a hunter")
end, end,
on_unassigned = function(pname) on_unassigned = function(pname)
sprint.decrease_maxstamina(pname, 10) sprint.decrease_maxstamina(pname, 20)
if tmp[pname] then if tmp[pname] then
sprint.decrease_maxstamina(pname, 10) sprint.decrease_maxstamina(pname, 10)
tmp[pname] = nil tmp[pname] = nil

View File

@ -12,7 +12,6 @@ pclasses.api.register_class("adventurer", {
if inform then if inform then
minetest.chat_send_player(pname, "You are now an adventurer") minetest.chat_send_player(pname, "You are now an adventurer")
end end
pclasses.api.util.on_update(pname)
end, end,
on_unassigned = function(pname) on_unassigned = function(pname)
end, end,