Skip to content

Commit ea0b0a0

Browse files
committed
SENT ClientThink
1 parent 233c0b4 commit ea0b0a0

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

‎Game.Shared/GarrysMod/SENT_Anim.cs‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,26 @@ public override bool GetShadowCastDirection(ref Vector3 direction, ShadowType sh
255255
}
256256

257257
public override void ClientThink() {
258+
ScriptedEntity.CallFunction((int)LUA_POOLEDSTRING.Think, false);
259+
260+
float max = WorldSize.MAX_COORD_INTEGER * 8.0f;
261+
ref Vector3 origin = ref GetNetworkOrigin();
262+
if (origin.X > -max && origin.X < max && origin.Y > -max && origin.Y < max && origin.Z > -max && origin.Z < max) {
263+
IPhysicsObject? physics = VPhysicsGetObject();
264+
if (physics == null)
265+
return;
266+
if (physics.GetShadowController() != null) {
267+
physics.UpdateShadow(origin, GetNetworkAngles(), false, 0);
268+
return;
269+
}
270+
if (physics.GetShadowController() == null)
271+
physics.SetPosition(origin, GetNetworkAngles(), true);
272+
}
273+
}
274+
275+
public override void Think() {
258276
if (!IsMarkedForDeletion() && !ScriptedEntity.CallFunction((int)LUA_POOLEDSTRING.Think, true))
259-
SetNextClientThink(gpGlobals.CurTime + 0.2);
277+
SetNextThink(gpGlobals.CurTime + 0.2);
260278
}
261279
#endif
262280

0 commit comments

Comments
 (0)