Fixed bug where disabling weapons disabling all knockback. Also fixed potential error when disabling hitgroups.
This commit is contained in:
		| @@ -71,24 +71,26 @@ KnockbackOnClientHurt(client, attacker, const String:weapon[], hitgroup, dmg_hea | |||||||
|     } |     } | ||||||
|      |      | ||||||
|     new bool:weapons = GetConVarBool(g_hCvarsList[CVAR_WEAPONS]); |     new bool:weapons = GetConVarBool(g_hCvarsList[CVAR_WEAPONS]); | ||||||
|     if (!weapons) |     if (weapons) | ||||||
|     { |     { | ||||||
|         return; |  | ||||||
|     } |  | ||||||
|      |  | ||||||
|         new weaponindex = WeaponsNameToIndex(weapon); |         new weaponindex = WeaponsNameToIndex(weapon); | ||||||
|         if (weaponindex != -1) |         if (weaponindex != -1) | ||||||
|         { |         { | ||||||
|             // Apply weapon knockback multiplier. |             // Apply weapon knockback multiplier. | ||||||
|             knockback *= WeaponsGetKnockback(weaponindex); |             knockback *= WeaponsGetKnockback(weaponindex); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|      |      | ||||||
|  |     new bool:hitgroups = GetConVarBool(g_hCvarsList[CVAR_HITGROUPS]); | ||||||
|  |     if (hitgroups) | ||||||
|  |     { | ||||||
|         new hitgroupindex = HitgroupToIndex(hitgroup); |         new hitgroupindex = HitgroupToIndex(hitgroup); | ||||||
|         if (hitgroupindex != -1) |         if (hitgroupindex != -1) | ||||||
|         { |         { | ||||||
|             // Apply hitgroup knockback multiplier. |             // Apply hitgroup knockback multiplier. | ||||||
|             knockback *= HitgroupsGetKnockback(hitgroupindex); |             knockback *= HitgroupsGetKnockback(hitgroupindex); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|      |      | ||||||
|     // Apply damage knockback multiplier. |     // Apply damage knockback multiplier. | ||||||
|     knockback *= float(dmg_health); |     knockback *= float(dmg_health); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user