1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

[mff_pclasses] Remember to remove hunter bonus

- MFF PClasses : Remove hunter armor bonus upon unassigning
This commit is contained in:
LeMagnesium 2017-04-20 00:05:26 +02:00
parent 1191a57374
commit 3035e9660e
No known key found for this signature in database
GPG Key ID: A54DDB5272C51E8B
2 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,10 @@ pclasses.api.register_class("hunter", {
end,
on_unassigned = function(pname)
sprint.decrease_maxstamina(pname, 10)
if tmp[pname] then
sprint.decrease_maxstamina(pname, 10)
tmp[pname] = nil
end
end,
on_update = function(pname)
local reinforced = pclasses.api.util.does_wear_full_armor(pname, "reinforcedleather", true)

View File

@ -55,8 +55,8 @@ end
function pclasses.api.set_player_class(pname, cname, inform)
if pclasses.api.get_class_by_name(cname) then
if pclasses.api.get_player_class(pname) then
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_unassigned(pname)
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_update(pname)
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_update(pname)
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_unassigned(pname)
end
pclasses.data.players[pname] = cname
local newclass = pclasses.api.get_class_by_name(cname)