Batfoxkid / FreakFortressBat

No longer supported.
https://github.com/Batfoxkid/Freak-Fortress-2-Rewrite
GNU General Public License v3.0
30 stars 20 forks source link

[Bug] Melee knockback doesnt work #165

Open eNNercY1337 opened 3 years ago

eNNercY1337 commented 3 years ago

Description

setting boss knockback via the available cvar ff2_selfknockback doesnt seem to activate it, neither ff2_selfknockback 1/2

Reproduce

Steps to reproduce the behavior:

  1. enable ff2_selfknockback "1"
  2. hitting the boss with any melee weapon doesnt work in the testing i've did only the festivized sandman gave the boss the knockback as it should but any others behave the same

Environment

a temporary workaround for this to be enabled on any meele weapon is the following

https://github.com/Batfoxkid/FreakFortressBat/blob/development/addons/sourcemod/scripting/freak_fortress_2.sp#L14058

replace with the following

if((damagetype & DMG_CLUB) && CritBoosted[client][2]!=0 && CritBoosted[client][2]!=1 && (TF2_GetPlayerClass(attacker)!=TFClass_Spy || CritBoosted[client][2]>1))
                {
                    int melee = GetIndexOfWeaponSlot(attacker, TFWeaponSlot_Melee);
                    if(CritBoosted[client][2]>1 || (melee!=416 && melee!=307 && melee!=44))
                    {
                        damagetype |= DMG_CRIT|DMG_PREVENT_PHYSICS_FORCE;
                        return Plugin_Changed;
                    }
                }
Batfoxkid commented 3 years ago

The reason why melee knockback doesn't occur is the line you mention but with the damagetype shown, DMG_PREVENT_PHYSICS_FORCE prevents knockback so removing it will give it knockback again.

                {
                    int melee = GetIndexOfWeaponSlot(attacker, TFWeaponSlot_Melee);
                    if(CritBoosted[client][2]>1 || (melee!=416 && melee!=307 && melee!=44))
                    {
                        damagetype |= DMG_CRIT;
                        return Plugin_Changed;
                    }
                }
eNNercY1337 commented 3 years ago

The reason why melee knockback doesn't occur is the line you mention but with the damagetype shown, DMG_PREVENT_PHYSICS_FORCE prevents knockback so removing it will give it knockback again.

              {
                  int melee = GetIndexOfWeaponSlot(attacker, TFWeaponSlot_Melee);
                  if(CritBoosted[client][2]>1 || (melee!=416 && melee!=307 && melee!=44))
                  {
                      damagetype |= DMG_CRIT;
                      return Plugin_Changed;
                  }
              }

but for what is that convar ff2_selfknockback for then? i assumed it would enable the knockback fully as the description of it also says.

i know that it can be fixed like that but every time an update gets released would've require to edit it again and recompile so i thought that its an unknown bug.

Batfoxkid commented 3 years ago

ff2_selfknockback is for bosses dealing knockback to themself commonly by rocket jumping.

eNNercY1337 commented 3 years ago

i see, it would still be great if there would be a convar to enable melee knockback if possible :)