Skip to content

Commit

Permalink
fix: update CNetworkQuantizedFloat to resolve to float
Browse files Browse the repository at this point in the history
closes #482
  • Loading branch information
roflmuffin committed Jul 26, 2024
1 parent b79fd19 commit 3860ca1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public CBaseAnimGraphController (IntPtr pointer) : base(pointer) {}

// m_flPlaybackRate
[SchemaMember("CBaseAnimGraphController", "m_flPlaybackRate")]
public float PlaybackRate => Schema.GetDeclaredClass<float>(this.Handle, "CBaseAnimGraphController", "m_flPlaybackRate");
public ref float PlaybackRate => ref Schema.GetRef<float>(this.Handle, "CBaseAnimGraphController", "m_flPlaybackRate");

// m_nNotifyState
[SchemaMember("CBaseAnimGraphController", "m_nNotifyState")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public CNetworkOriginCellCoordQuantizedVector (IntPtr pointer) : base(pointer) {

// m_vecX
[SchemaMember("CNetworkOriginCellCoordQuantizedVector", "m_vecX")]
public float X => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkOriginCellCoordQuantizedVector", "m_vecX");
public ref float X => ref Schema.GetRef<float>(this.Handle, "CNetworkOriginCellCoordQuantizedVector", "m_vecX");

// m_vecY
[SchemaMember("CNetworkOriginCellCoordQuantizedVector", "m_vecY")]
public float Y => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkOriginCellCoordQuantizedVector", "m_vecY");
public ref float Y => ref Schema.GetRef<float>(this.Handle, "CNetworkOriginCellCoordQuantizedVector", "m_vecY");

// m_vecZ
[SchemaMember("CNetworkOriginCellCoordQuantizedVector", "m_vecZ")]
public float Z => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkOriginCellCoordQuantizedVector", "m_vecZ");
public ref float Z => ref Schema.GetRef<float>(this.Handle, "CNetworkOriginCellCoordQuantizedVector", "m_vecZ");

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public CNetworkVelocityVector (IntPtr pointer) : base(pointer) {}

// m_vecX
[SchemaMember("CNetworkVelocityVector", "m_vecX")]
public float X => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkVelocityVector", "m_vecX");
public ref float X => ref Schema.GetRef<float>(this.Handle, "CNetworkVelocityVector", "m_vecX");

// m_vecY
[SchemaMember("CNetworkVelocityVector", "m_vecY")]
public float Y => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkVelocityVector", "m_vecY");
public ref float Y => ref Schema.GetRef<float>(this.Handle, "CNetworkVelocityVector", "m_vecY");

// m_vecZ
[SchemaMember("CNetworkVelocityVector", "m_vecZ")]
public float Z => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkVelocityVector", "m_vecZ");
public ref float Z => ref Schema.GetRef<float>(this.Handle, "CNetworkVelocityVector", "m_vecZ");

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public CNetworkViewOffsetVector (IntPtr pointer) : base(pointer) {}

// m_vecX
[SchemaMember("CNetworkViewOffsetVector", "m_vecX")]
public float X => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkViewOffsetVector", "m_vecX");
public ref float X => ref Schema.GetRef<float>(this.Handle, "CNetworkViewOffsetVector", "m_vecX");

// m_vecY
[SchemaMember("CNetworkViewOffsetVector", "m_vecY")]
public float Y => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkViewOffsetVector", "m_vecY");
public ref float Y => ref Schema.GetRef<float>(this.Handle, "CNetworkViewOffsetVector", "m_vecY");

// m_vecZ
[SchemaMember("CNetworkViewOffsetVector", "m_vecZ")]
public float Z => Schema.GetDeclaredClass<float>(this.Handle, "CNetworkViewOffsetVector", "m_vecZ");
public ref float Z => ref Schema.GetRef<float>(this.Handle, "CNetworkViewOffsetVector", "m_vecZ");

}
5 changes: 3 additions & 2 deletions managed/CounterStrikeSharp.SchemaGen/SchemaFieldType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public SchemaFieldType(string Name,
this.Atomic = Atomic;
this.Inner = Inner;

if (this.Name == "GameTime_t")
if (this.Name == "GameTime_t" || this.Name == "CNetworkedQuantizedFloat")
{
this.Category = SchemaTypeCategory.Builtin;
this.Name = "float32";
Expand Down Expand Up @@ -99,7 +99,8 @@ private static string AtomicToCsTypeName(string name, SchemaAtomicCategory atomi
{
SchemaTypeCategory.Builtin => BuiltinToCsKeyword(Name),
SchemaTypeCategory.Ptr => IsString
? "string" : $"{Inner!.CsTypeName}?",
? "string"
: $"{Inner!.CsTypeName}?",
SchemaTypeCategory.FixedArray => IsString
? "string"
: $"{Inner!.CsTypeName}[]",
Expand Down

0 comments on commit 3860ca1

Please sign in to comment.