Fix sourcepawn bug

This commit is contained in:
BotoX 2019-11-14 17:20:42 +01:00
parent 657102ea76
commit eda8971996
2 changed files with 19 additions and 7 deletions

View File

@ -1429,8 +1429,7 @@ stock ClassDataTypes:ClassGetAttributeType(attributeflag)
ZR_CLASS_HEALTH_REGEN_INTERVAL,
ZR_CLASS_SPEED,
ZR_CLASS_KNOCKBACK,
ZR_CLASS_JUMP_HEIGHT,
ZR_CLASS_JUMP_DISTANCE:
ZR_CLASS_JUMP_HEIGHT:
{
return ClassDataType_Float;
}
@ -1446,6 +1445,15 @@ stock ClassDataTypes:ClassGetAttributeType(attributeflag)
{
return ClassDataType_String;
}
default:
{
// sourcepawn bug fix
if (attributeflag == ZR_CLASS_JUMP_DISTANCE)
{
return ClassDataType_Float;
}
}
}
// Invalid flag or multiple flags combined.

View File

@ -873,14 +873,18 @@ stock ClassModifyFloat(classindex, attributeflag, Float:value, bool:ismultiplier
ClassDataCache[classindex][Class_JumpHeight] = value;
return true;
}
case ZR_CLASS_JUMP_DISTANCE:
default:
{
if (ismultiplier)
// sourcepawn bug fix
if (attributeflag == ZR_CLASS_JUMP_DISTANCE)
{
value = ClassData[classindex][Class_JumpDistance] * value;
if (ismultiplier)
{
value = ClassData[classindex][Class_JumpDistance] * value;
}
ClassDataCache[classindex][Class_JumpDistance] = value;
return true;
}
ClassDataCache[classindex][Class_JumpDistance] = value;
return true;
}
}