Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Game.Client/C_BaseAnimating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public override void ResetLatched() {

base.ResetLatched();
}
public bool IsRagdoll() => Ragdoll != null && RenderFX == (byte)RenderFx.Ragdoll;
public override bool IsRagdoll() => Ragdoll != null && RenderFX == (byte)RenderFx.Ragdoll;

public override ShadowType ShadowCastType() {
StudioHdr? studioHdr = GetModelPtr();
Expand Down
2 changes: 1 addition & 1 deletion Game.Server/BaseAnimating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ public virtual bool BecomeRagdollOnClient(in Vector3 force) {
return false;
}

public bool IsRagdoll() => RenderFX == (byte)RenderFx.Ragdoll;
public override bool IsRagdoll() => RenderFX == (byte)RenderFx.Ragdoll;

public override void Teleport(Vector3? newPosition, QAngle? newAngles, Vector3? newVelocity) {
base.Teleport(newPosition, newAngles, newVelocity);
Expand Down
1 change: 1 addition & 0 deletions Game.Shared/GarrysMod/BaseEntityLua.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static int LuaCallbackIndex(ReadOnlySpan<char> name) {
public virtual bool IsWeapon() => false;
public virtual bool IsVehicle() => false;
public virtual bool IsRagdollProp() => false;
public virtual bool IsRagdoll() => false;
public virtual bool IsJeep() => false;
public virtual void PostLuaSpawn() { }
public virtual ReadOnlySpan<char> GetLuaScriptName() => null;
Expand Down
7 changes: 7 additions & 0 deletions Game.Shared/GarrysMod/LuaEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ static int Entity__IsNPC(ILuaInterface lua) {
return 1;
}

[LuaMethod]
static int Entity__IsRagdoll(ILuaInterface lua) {
BaseEntity? ent = Get_Entity(1, true);
lua.PushBool(ent != null && ent.IsRagdoll());
return 1;
}

[LuaMethod]
static int Entity__IsScripted(ILuaInterface lua) {
BaseEntity ent = Get_Entity(1, false)!;
Expand Down
4 changes: 3 additions & 1 deletion Game.Shared/GarrysMod/LuaGameSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#if CLIENT_DLL || GAME_DLL
using Game.Shared;

Expand Down Expand Up @@ -41,7 +42,8 @@ public override void LevelInitPreEntity() {
gGM.LoadGamemode(Gamemode, false);
gGM.SetGamemode(Gamemode, true);
}
RecacheMaterials();
// Currently breaking things, uncomment once the path is fully implemented.
// RecacheMaterials();
}

static void RecacheMaterials() {
Expand Down
Loading