Skip to content

Commit 12eb37a

Browse files
committed
Character Load / Delete Bug Fixed.
1 parent 4861e62 commit 12eb37a

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

nutscript/gamemode/derma/cl_charlist.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ function PANEL:SetCharacter(index, deleteCallback)
121121
self.model:SetAlpha(banned and 50 or 255)
122122

123123
self.delete.DoClick = function(panel)
124-
LocalPlayer().characters[index] = nil;
125-
126124
local orignalChoose = self.choose.DoClick;
127125
local orignalDelete = self.delete.DoClick;
128126

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

135+
LocalPlayer().characters[index] = nil;
136+
137137
netstream.Start("nut_CharDelete", self.index);
138138
deleteCallback();
139139
end;

nutscript/gamemode/kernel/sv_kernel.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ function GM:PlayerCreatedChar(client, data) end
509509
function GM:PostPlayerSpawn(client)
510510
local factionData = nut.faction.GetByID(client:Team());
511511

512-
if(factionData.defaultMaxHealth) then
513-
client:SetMaxHealth(defaultMaxHealth);
514-
client:SetHealth(defaultMaxHealth);
512+
if (factionData.defaultMaxHealth) then
513+
client:SetMaxHealth(factionData.defaultMaxHealth);
514+
client:SetHealth(factionData.defaultMaxHealth);
515515
end
516516

517517
if(factionData.defaultArmor) then

nutscript/gamemode/libs/sh_character.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,7 @@ if (SERVER) then
664664
inventory.buffer = {}
665665

666666
function inventory:Add(class, quantity, data2)
667-
if (IsValid(nut.item.Get(class))) then
668-
self.buffer = nut.util.StackInv(self.buffer, class, quantity, data2);
669-
else
670-
ErrorNoHalt("Character Default Item missing - Class : "..class.."\n");
671-
end
667+
self.buffer = nut.util.StackInv(self.buffer, class, quantity, data2);
672668
end
673669

674670
AdvNut.hook.Run("GetDefaultInv", inventory, client, charData)

nutscript/gamemode/libs/sh_faction.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ function nut.faction.Register(index, uniqueID, faction)
153153
faction.femaleModels = faction.femaleModels or FEMALE_MODELS;
154154
faction.pay = faction.pay or 0;
155155
faction.payTime = faction.payTime or 600;
156-
faction.defaultItem = faction.defaultItem;
156+
faction.defaultItem = faction.defaultItem or { };
157+
faction.defaultAttributes = defaultAttributes or { };
158+
faction.defaultMaxHealth = faction.defaultMaxHealth or 100;
159+
faction.defaultArmor = faction.defaultArmor or 0;
157160

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

nutscript/gamemode/sh_config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313
nut.config = nut.config or {}
1414

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

1818
-- What language Nutscript shall use.
1919
nut.config.language = "korean"

0 commit comments

Comments
 (0)