Fixed NumericEvalValues always being evaluated as integers.
This commit is contained in:
parent
601fec8048
commit
415f03efc3
|
@ -74,6 +74,9 @@ namespace PorygonSharp.EvalValues
|
||||||
case TypeClass.Nil:
|
case TypeClass.Nil:
|
||||||
return null;
|
return null;
|
||||||
case TypeClass.Number:
|
case TypeClass.Number:
|
||||||
|
if (IsNumericValueFloat(Handle) == 1)
|
||||||
|
return EvaluateFloat();
|
||||||
|
else
|
||||||
return EvaluateInteger();
|
return EvaluateInteger();
|
||||||
case TypeClass.Bool:
|
case TypeClass.Bool:
|
||||||
return EvaluateBool();
|
return EvaluateBool();
|
||||||
|
@ -98,6 +101,10 @@ namespace PorygonSharp.EvalValues
|
||||||
private static extern int GetTypeClass(IntPtr ptr);
|
private static extern int GetTypeClass(IntPtr ptr);
|
||||||
[DllImport("PorygonLang", EntryPoint = "GetEvalValueType", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("PorygonLang", EntryPoint = "GetEvalValueType", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr GetScriptType(IntPtr ptr);
|
private static extern IntPtr GetScriptType(IntPtr ptr);
|
||||||
|
|
||||||
|
[DllImport("PorygonLang", EntryPoint = "IsNumericValueFloat", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
private static extern byte IsNumericValueFloat(IntPtr ptr);
|
||||||
|
|
||||||
[DllImport("PorygonLang", EntryPoint = "EvaluateEvalValueInteger", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("PorygonLang", EntryPoint = "EvaluateEvalValueInteger", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern long EvaluateInteger(IntPtr ptr);
|
private static extern long EvaluateInteger(IntPtr ptr);
|
||||||
[DllImport("PorygonLang", EntryPoint = "EvaluateEvalValueFloat", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("PorygonLang", EntryPoint = "EvaluateEvalValueFloat", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
|
Loading…
Reference in New Issue