Fixed class speed multiplier not properly applied with prop speed method (bug 199).

This commit is contained in:
Richard Helgeby 2010-08-06 16:19:30 +02:00
parent 86678a9025
commit 965f637562
1 changed files with 20 additions and 1 deletions

View File

@ -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;