mirror of
https://github.com/hermansimensen/eventqueue-fix.git
synced 2025-12-07 10:28:25 +00:00
Fix type recognition for logic entities
This commit is contained in:
parent
de8fdf911b
commit
c1ce607fb0
@ -249,12 +249,22 @@ public void ResolveVariantValue(Handle ¶ms, event_t event)
|
|||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
|
//Float
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
float fVar = DHookGetParamObjectPtrVar(params, 3, 0, ObjectValueType_Float);
|
float fVar = DHookGetParamObjectPtrVar(params, 3, 0, ObjectValueType_Float);
|
||||||
FloatToString(fVar, event.variantValue, sizeof(event.variantValue));
|
|
||||||
|
//Type recognition is difficult, even for valve programmers. Sometimes floats are integers, lets fix that.
|
||||||
|
if(FloatAbs(fVar - RoundFloat(fVar)) < 0.000001)
|
||||||
|
{
|
||||||
|
IntToString(RoundFloat(fVar), event.variantValue, sizeof(event.variantValue));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
FloatToString(fVar, event.variantValue, sizeof(event.variantValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Integer
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
int iVar = DHookGetParamObjectPtrVar(params, 3, 0, ObjectValueType_Int);
|
int iVar = DHookGetParamObjectPtrVar(params, 3, 0, ObjectValueType_Int);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user