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