Skip to content

Commit 871ac37

Browse files
committed
More lua impl
1 parent 55f4d49 commit 871ac37

15 files changed

Lines changed: 353 additions & 30 deletions

‎Game.Client/C_BaseEntity.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ public virtual bool GetSoundSpatialization(ref SpatializationInfo info) {
10741074
public virtual void ValidateModelIndex() {
10751075
SetModelByIndex(ModelIndex);
10761076
}
1077-
void SetModelPointer(Model? model) {
1077+
public void SetModelPointer(Model? model) {
10781078
if (model != Model) {
10791079
DestroyModelInstance();
10801080
Model = model;

‎Game.Client/C_PropJeep.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class C_PropJeep : C_PropVehicleDriveable
1818

1919
[NetworkName("m_bHeadlightIsOn")]
2020
public bool HeadlightIsOn;
21+
22+
public override bool IsJeep() => true;
2123
}
2224

2325
[NetworkName("CPropJeepEpisodic")]

‎Game.Client/C_RagdollProp.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ .. Enumerable.Range(0, RAGDOLL_MAX_ELEMENTS).Select(i => RecvPropQAngles(FIELD.O
2828
public float BlendWeight;
2929
[NetworkName("m_nOverlaySequence")]
3030
public int OverlaySequence;
31+
32+
public override bool IsRagdollProp() => true;
3133
}

‎Game.Client/HL2MP/C_HL2MP_Player.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,6 @@ public class C_HL2MPRagdoll : C_BaseAnimatingOverlay
136136
public EHANDLE Player = new();
137137
[NetworkName("m_vecRagdollVelocity")]
138138
public Vector3 RagdollVelocity;
139+
140+
public override bool IsRagdollProp() => true;
139141
}

‎Game.Server/HL2/PropVehiclePrisonerPod.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ public class PropVehiclePrisonerPod : PhysicsProp
3333
public bool LimitView = new();
3434
[NetworkName("m_bLocked")]
3535
public bool Locked;
36+
37+
public override bool IsVehicle() => true;
3638
}

‎Game.Server/PropCrane.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ public class PropCrane : BaseAnimating
2727
public bool ExitAnimOn;
2828
[NetworkName("m_vecEyeExitEndpoint")]
2929
public Vector3 EyeExitEndpoint;
30+
31+
public override bool IsVehicle() => true;
3032
}

‎Game.Server/PropJeep.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class PropJeep : PropVehicleDriveable
1818

1919
[NetworkName("m_bHeadlightIsOn")]
2020
public bool HeadlightIsOn;
21+
22+
public override bool IsJeep() => true;
2123
}
2224

2325
[LinkEntityToClass("prop_vehicle_jeep")]

‎Game.Server/PropVehicleDriveable.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ public class PropVehicleDriveable : BaseAnimating
5656
public Vector3 GunCrosshair;
5757
[NetworkName("m_bLocked")]
5858
public bool Locked;
59+
60+
public override bool IsVehicle() => true;
5961
}

‎Game.Server/RagdollProp.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ .. Enumerable.Range(0, RAGDOLL_MAX_ELEMENTS).Select(i => SendPropQAngles(FIELD.O
4040
public static bool Ragdoll_IsPropRagdoll(BaseEntity entity) => entity is RagdollProp;
4141

4242
public static Ragdoll? Ragdoll_GetRagdoll(BaseEntity entity) => (entity as RagdollProp)?.GetRagdoll();
43+
44+
public override bool IsRagdollProp() => true;
4345
}

‎Game.Server/World.cs‎

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,6 @@ public World() {
4949
ColdWorld = false;
5050
}
5151

52-
public override bool KeyValue(ReadOnlySpan<char> keyName, ReadOnlySpan<char> value) {
53-
if (keyName.Equals("skyname", StringComparison.Ordinal)) {
54-
ConVarRef skyname = new("sv_skyname");
55-
skyname.SetValue(value);
56-
}
57-
else if (keyName.Equals("newunit", StringComparison.Ordinal)) {
58-
// if (atoi(value) != 0)
59-
// Game_SetOneWayTransition();
60-
}
61-
else if (keyName.Equals("world_mins", StringComparison.Ordinal)) {
62-
Vector3 vec = default;
63-
UTIL_StringToVector(vec.Base(), value);
64-
WorldMins = vec;
65-
}
66-
else if (keyName.Equals("world_maxs", StringComparison.Ordinal)) {
67-
Vector3 vec = default;
68-
UTIL_StringToVector(vec.Base(), value);
69-
WorldMaxs = vec;
70-
}
71-
else
72-
return base.KeyValue(keyName, value);
73-
74-
return true;
75-
}
76-
7752
public override void Precache() {
7853
g_WorldEntity = this;
7954
g_fGameOver = false;
@@ -134,6 +109,10 @@ public override bool KeyValue(ReadOnlySpan<char> keyName, ReadOnlySpan<char> val
134109
ConVarRef skyname = new("sv_skyname");
135110
skyname.SetValue(value);
136111
}
112+
else if (FStrEq(keyName, "newunit")) {
113+
// if (atoi(value) != 0)
114+
// Game_SetOneWayTransition();
115+
}
137116
else if (FStrEq(keyName, "world_mins")) {
138117
Vector3 vec = default;
139118
UTIL_StringToVector(vec.Base(), value);

0 commit comments

Comments
 (0)