Conversation
| if (type == typeof(Color)) | ||
| { | ||
| var pointer = (IntPtr)GetResult(typeof(IntPtr), ptr); | ||
| return Marshaling.ColorMarshaler.NativeToManaged(pointer); | ||
| } |
There was a problem hiding this comment.
This one should be there since the beginning I believe haha
| if (type == typeof(CEntityHandle)) | ||
| { | ||
| return new CEntityHandle((uint)GetResult(typeof(uint), ptr)); | ||
| } |
There was a problem hiding this comment.
I hope this one fits?
|
|
||
| case counterstrikesharp::TYPE_COLOR: | ||
| { | ||
| script_context.SetResult(new Color(keyValues->GetColor(key))); |
| script_context.SetResult(new Vector(keyValues->GetVector(key))); | ||
| break; | ||
| } | ||
|
|
||
| case counterstrikesharp::TYPE_VECTOR2D: | ||
| { | ||
| script_context.SetResult(new Vector2D(keyValues->GetVector2D(key))); | ||
| break; | ||
| } | ||
|
|
||
| case counterstrikesharp::TYPE_VECTOR4D: | ||
| { | ||
| script_context.SetResult(new Vector4D(keyValues->GetVector4D(key))); | ||
| break; | ||
| } | ||
|
|
||
| case counterstrikesharp::TYPE_QUATERNION: | ||
| { | ||
| script_context.SetResult(new Quaternion(keyValues->GetQuaternion(key))); | ||
| break; | ||
| } | ||
|
|
||
| case counterstrikesharp::TYPE_QANGLE: | ||
| { | ||
| script_context.SetResult(new QAngle(keyValues->GetQAngle(key))); | ||
| break; | ||
| } | ||
|
|
||
| case counterstrikesharp::TYPE_MATRIX3X4: | ||
| { | ||
| script_context.SetResult(new matrix3x4_t(keyValues->GetMatrix3x4(key))); |
There was a problem hiding this comment.
These should not leak with #613 because the wrapper classes will be DisposableMemory and when its no longer used on the managed side these pointers are released
| Vector2D* Vector2DNew(ScriptContext& script_context) | ||
| { | ||
| return new Vector2D(); | ||
| } | ||
|
|
||
| Vector4D* Vector4DNew(ScriptContext& script_context) | ||
| { | ||
| return new Vector4D(); | ||
| } | ||
|
|
||
| matrix3x4_t* Matrix3x4New(ScriptContext& script_context) | ||
| { | ||
| return new matrix3x4_t(); | ||
| } | ||
|
|
||
| Quaternion* QuaternionNew(ScriptContext& script_context) | ||
| { | ||
| return new Quaternion(); | ||
| } |
|
|
||
| CEntityKeyValues* EntityKeyValuesNew(ScriptContext& script_context) | ||
| { | ||
| return new CEntityKeyValues(); |
There was a problem hiding this comment.
forgot to mention that this one is also will be released with #613
…`, `matrix3x4_t`
293a3a8 to
7d346df
Compare
|
Would be nice to have this released, otherwise prop_ragdoll bugs with velocity without setting pos before dispatchspawn |
|
I have tested this specific PR on Linux and it's working fine. |
|
Any update on this? :) |
|
Is there any update on this? :) would love to have it merged if possible. |
|
Any updates on this PR? Would be great to have this merged. |
|
Please, give any information about it @KillStr3aK |
other than the conflicts with the main branch the pr is ready, and it does not depend on #613 , but it would just bring even more leaks to the table. I did not look for a solution since that as I'm busy these days but the main implementation is here if someone finds a solution for the leak issues faster than I do |
Mostly based on #440 by @Yarukon
Implemented
CEntityKeyValues, can be used like:This is also possible:
Also implemented some of the math related classes minimally, however: we need #613 in order to prevent memory leaks related to them. (changes needed later on if this one gets merged earlier, or I can make the adjustments on this if 613 is merged.)