From eda8971996378382ce611d0e247871fa61a95288 Mon Sep 17 00:00:00 2001 From: BotoX Date: Thu, 14 Nov 2019 17:20:42 +0100 Subject: [PATCH] Fix sourcepawn bug --- src/zr/playerclasses/attributes.inc | 12 ++++++++++-- src/zr/playerclasses/classcommands.inc | 14 +++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/zr/playerclasses/attributes.inc b/src/zr/playerclasses/attributes.inc index 47d6640..76f53eb 100644 --- a/src/zr/playerclasses/attributes.inc +++ b/src/zr/playerclasses/attributes.inc @@ -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. diff --git a/src/zr/playerclasses/classcommands.inc b/src/zr/playerclasses/classcommands.inc index ce24231..b33eef7 100644 --- a/src/zr/playerclasses/classcommands.inc +++ b/src/zr/playerclasses/classcommands.inc @@ -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; } }