diff --git a/addons/sourcemod/scripting/freak_fortress_2/weapons.sp b/addons/sourcemod/scripting/freak_fortress_2/weapons.sp index 4eb4db6..e5ff4f9 100644 --- a/addons/sourcemod/scripting/freak_fortress_2/weapons.sp +++ b/addons/sourcemod/scripting/freak_fortress_2/weapons.sp @@ -474,6 +474,7 @@ stock void Weapons_OnHitBossPre(int attacker, int victim, float &damage, int wea #if defined __tf_custom_attributes_included if(TCALoaded && weapon != -1 && HasEntProp(weapon, Prop_Send, "m_AttributeList")) { + char buffer[36]; KeyValues kv = TF2CustAttr_GetAttributeKeyValues(weapon); if(kv) { @@ -507,7 +508,6 @@ stock void Weapons_OnHitBossPre(int attacker, int victim, float &damage, int wea if(value != 1.0) Client(victim).RageDebuff *= value; - char buffer[36]; if(damagecustom != TF_CUSTOM_BURNING && damagecustom != TF_CUSTOM_BURNING_FLARE && damagecustom != TF_CUSTOM_BURNING_ARROW) { kv.GetString("mod attribute hit stale", buffer, sizeof(buffer)); @@ -528,25 +528,6 @@ stock void Weapons_OnHitBossPre(int attacker, int victim, float &damage, int wea } } - if(GetEntityClassname(weapon, buffer, sizeof(buffer))) - { - int slot = TF2_GetClassnameSlot(buffer); - if(slot >= TFWeaponSlot_Primary && slot <= TFWeaponSlot_Melee) - { - int entity, i; - while(TF2_GetItem(attacker, entity, i)) - { - if(entity == weapon) - continue; - - static const char AttribName[][] = { "primary damage vs bosses", "secondary damage vs bosses", "melee damage vs bosses" }; - value = TF2CustAttr_GetFloat(entity, AttribName[slot], 1.0); - if(value != 1.0) - damage *= value; - } - } - } - if(TF2_IsPlayerInCondition(attacker, TFCond_BlastJumping)) { value = kv.GetFloat("mid-air damage vs bosses", 1.0); @@ -580,6 +561,25 @@ stock void Weapons_OnHitBossPre(int attacker, int victim, float &damage, int wea } delete kv; + + if(GetEntityClassname(weapon, buffer, sizeof(buffer))) + { + int slot = TF2_GetClassnameSlot(buffer); + if(slot >= TFWeaponSlot_Primary && slot <= TFWeaponSlot_Melee) + { + int entity, i; + while(TF2_GetItem(attacker, entity, i)) + { + if(entity == weapon) + continue; + + static const char AttribName[][] = { "primary damage vs bosses", "secondary damage vs bosses", "melee damage vs bosses" }; + float value = TF2CustAttr_GetFloat(entity, AttribName[slot], 1.0); + if(value != 1.0) + damage *= value; + } + } + } } #endif }