From 965f637562426be54b2c6961d414199e4356e53d Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Fri, 6 Aug 2010 16:19:30 +0200 Subject: [PATCH] Fixed class speed multiplier not properly applied with prop speed method (bug 199). --- src/zr/playerclasses/attributes.inc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/zr/playerclasses/attributes.inc b/src/zr/playerclasses/attributes.inc index 274e263..5fee22f 100644 --- a/src/zr/playerclasses/attributes.inc +++ b/src/zr/playerclasses/attributes.inc @@ -935,7 +935,26 @@ stock Float:ClassGetSpeed(index, cachetype = ZR_CLASS_CACHE_PLAYER) } case ZR_CLASS_CACHE_PLAYER: { - return ClassPlayerCache[index][Class_Speed] * ClassGetAttributeMultiplier(index, ClassM_Speed); + new Float:speed = ClassPlayerCache[index][Class_Speed]; + new Float:multiplier = ClassGetAttributeMultiplier(index, ClassM_Speed); + + // Apply multiplier. + if (ClassSpeedMethod == ClassSpeed_Prop) + { + // Prop speed is an offset. Convert to absolute value. + speed += 250; + + // Apply multiplier. + speed *= multiplier; + + // Convert back to speed offset. + speed -= 250; + } + else + { + speed *= multiplier; + } + return speed; } } return -1.0;