Skip to content

Commit

Permalink
fix(cl_main): Prevent client lua error (#1682)
Browse files Browse the repository at this point in the history
This fixes #1648 in cases where not all entities have been initialized
for a client.
  • Loading branch information
Histalek authored Nov 27, 2024
1 parent ad73933 commit 80a0f3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed spectating player still being visible through thermalvision after killing that player (by @MrXonte)
- Fixed Magneto-stick not using C_Hands (by @SvveetMavis)
- Fixed console error when dropping ammo for weapons with no AmmoEnt (by @MrXonte)
- Fixed client error for a not fully initialized client (by @Histalek)
- Fixed the targetID corpse hint not respecting `ttt_identify_body_woconfirm` (by @Histalek)
- Fixed the beacon not being properly translated when placed (by @Histalek)

Expand Down
2 changes: 1 addition & 1 deletion gamemodes/terrortown/gamemode/client/cl_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ function GM:ClearClientState()

local client = LocalPlayer()

if not client:IsReady() then
if not IsValid(client) or not client:IsReady() then
return
end

Expand Down

0 comments on commit 80a0f3d

Please sign in to comment.