Skip to content

Commit 7157941

Browse files
authored
Fixed null physics object error for doors (#1815)
This PR fixes #1813 . I tested it and I couldn't reproduce the error from the above issue again.
1 parent 0df7276 commit 7157941

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
1313
- Fixed ghost viewmodels briefly appearing from weapons held by other players (by @TW1STaL1CKY)
1414
- Fixed corpses not inheriting the bodygroups from the players model (by @NickCloudAT)
1515
- Fixed edgecases where ttt_flame entities break when their extra entities fail to initialise (by @TW1STaL1CKY)
16+
- Fixed null physics object error for doors (by @mexikoedi)
1617

1718
## [v0.14.3b](https://github.com/TTT-2/TTT2/tree/v0.14.3b) (2025-03-18)
1819

gamemodes/terrortown/gamemode/shared/sh_door.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ if SERVER then
414414

415415
doorProp.isDoorProp = true
416416

417-
doorProp:GetPhysicsObject():ApplyForceCenter(pushForce or Vector(0, 0, 0))
417+
local physObj = doorProp:GetPhysicsObject()
418+
419+
if IsValid(physObj) then
420+
physObj:ApplyForceCenter(pushForce or Vector(0, 0, 0))
421+
end
418422

419423
---
420424
-- @realm server

0 commit comments

Comments
 (0)