You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Clockwork/garrysmod/gamemodes/clockwork/framework/sv_kernel.lua
+31-19Lines changed: 31 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -3412,21 +3412,23 @@ function Clockwork:PlayerDeath(player, inflictor, attacker, damageInfo)
3412
3412
end;
3413
3413
end;
3414
3414
3415
-
if (attacker:IsPlayer()) then
3416
-
if (IsValid(attacker:GetActiveWeapon())) then
3417
-
localweapon=attacker:GetActiveWeapon();
3418
-
localitemTable=cwItem:GetByWeapon(weapon);
3419
-
3420
-
if (IsValid(weapon) anditemTable) then
3421
-
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:Name().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name().." with "..itemTable("name")..", killing them!");
3415
+
if (damageInfo) then
3416
+
if (attacker:IsPlayer()) then
3417
+
if (IsValid(attacker:GetActiveWeapon())) then
3418
+
localweapon=attacker:GetActiveWeapon();
3419
+
localitemTable=cwItem:GetByWeapon(weapon);
3420
+
3421
+
if (IsValid(weapon) anditemTable) then
3422
+
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:Name().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name().." with "..itemTable("name")..", killing them!");
3423
+
else
3424
+
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:Name().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name().." with "..cwPly:GetWeaponClass(attacker)..", killing them!");
3425
+
end;
3422
3426
else
3423
-
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:Name().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name().." with "..cwPly:GetWeaponClass(attacker)..", killing them!");
3427
+
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:Name().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name()..", killing them!");
3424
3428
end;
3425
3429
else
3426
-
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:Name().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name()..", killing them!");
3430
+
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:GetClass().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name()..", killing them!");
3427
3431
end;
3428
-
else
3429
-
cwKernel:PrintLog(LOGTYPE_CRITICAL, attacker:GetClass().." has dealt "..tostring(math.ceil(damageInfo:GetDamage())).." damage to "..player:Name()..", killing them!");
3430
3432
end;
3431
3433
end;
3432
3434
@@ -3619,18 +3621,21 @@ function Clockwork:EntityTakeDamage(entity, damageInfo)
3619
3621
entity.cwDamageImmunity=curTime+1;
3620
3622
3621
3623
damageInfo:SetDamage(0);
3624
+
3622
3625
returnfalse;
3623
3626
end;
3624
3627
3625
3628
if (IsValid(attacker) andattacker:GetClass() =="worldspawn"
3626
3629
andentity.cwDamageImmunityandentity.cwDamageImmunity>curTime) then
3627
3630
damageInfo:SetDamage(0);
3631
+
3628
3632
returnfalse;
3629
3633
end;
3630
3634
3631
3635
if ((IsValid(inflictor) andinflictor:IsBeingHeld())
3632
3636
orattacker:IsBeingHeld()) then
3633
3637
damageInfo:SetDamage(0);
3638
+
3634
3639
returnfalse;
3635
3640
end;
3636
3641
end;
@@ -3676,13 +3681,17 @@ function Clockwork:EntityTakeDamage(entity, damageInfo)
0 commit comments