Skip to content

Commit

Permalink
Character Load / Delete Bug Fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
10sa committed May 6, 2017
1 parent 4861e62 commit 12eb37a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nutscript/gamemode/derma/cl_charlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ function PANEL:SetCharacter(index, deleteCallback)
self.model:SetAlpha(banned and 50 or 255)

self.delete.DoClick = function(panel)
LocalPlayer().characters[index] = nil;

local orignalChoose = self.choose.DoClick;
local orignalDelete = self.delete.DoClick;

Expand All @@ -134,6 +132,8 @@ function PANEL:SetCharacter(index, deleteCallback)
self.delete:SetText(nut.lang.Get("delete"));
self.delete.DoClick = orignalDelete;

LocalPlayer().characters[index] = nil;

netstream.Start("nut_CharDelete", self.index);
deleteCallback();
end;
Expand Down
6 changes: 3 additions & 3 deletions nutscript/gamemode/kernel/sv_kernel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,9 @@ function GM:PlayerCreatedChar(client, data) end
function GM:PostPlayerSpawn(client)
local factionData = nut.faction.GetByID(client:Team());

if(factionData.defaultMaxHealth) then
client:SetMaxHealth(defaultMaxHealth);
client:SetHealth(defaultMaxHealth);
if (factionData.defaultMaxHealth) then
client:SetMaxHealth(factionData.defaultMaxHealth);
client:SetHealth(factionData.defaultMaxHealth);
end

if(factionData.defaultArmor) then
Expand Down
6 changes: 1 addition & 5 deletions nutscript/gamemode/libs/sh_character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,7 @@ if (SERVER) then
inventory.buffer = {}

function inventory:Add(class, quantity, data2)
if (IsValid(nut.item.Get(class))) then
self.buffer = nut.util.StackInv(self.buffer, class, quantity, data2);
else
ErrorNoHalt("Character Default Item missing - Class : "..class.."\n");
end
self.buffer = nut.util.StackInv(self.buffer, class, quantity, data2);
end

AdvNut.hook.Run("GetDefaultInv", inventory, client, charData)
Expand Down
5 changes: 4 additions & 1 deletion nutscript/gamemode/libs/sh_faction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ function nut.faction.Register(index, uniqueID, faction)
faction.femaleModels = faction.femaleModels or FEMALE_MODELS;
faction.pay = faction.pay or 0;
faction.payTime = faction.payTime or 600;
faction.defaultItem = faction.defaultItem;
faction.defaultItem = faction.defaultItem or { };
faction.defaultAttributes = defaultAttributes or { };
faction.defaultMaxHealth = faction.defaultMaxHealth or 100;
faction.defaultArmor = faction.defaultArmor or 0;

team.SetUp(index, faction.name, faction.color);

Expand Down
2 changes: 1 addition & 1 deletion nutscript/gamemode/sh_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
nut.config = nut.config or {}

// Don't Touch This, This's Version Counter. //
nut.config.frameworkVersion = "Dev-0.21";
nut.config.frameworkVersion = "Dev-0.21a";

-- What language Nutscript shall use.
nut.config.language = "korean"
Expand Down

0 comments on commit 12eb37a

Please sign in to comment.