Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

[Bug] Melee knockback doesnt work #165

Open
eNNercY1337 opened this issue Oct 28, 2021 · 4 comments
Open

[Bug] Melee knockback doesnt work #165

eNNercY1337 opened this issue Oct 28, 2021 · 4 comments
Labels
Bug Something isn't working

Comments

@eNNercY1337
Copy link
Contributor

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

  • OS: Linux
  • SourceMod v1.10.0.6512
  • Freak Fortress Version 1.20.4

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;
					}
				}
@eNNercY1337 eNNercY1337 added the Bug Something isn't working label Oct 28, 2021
@Batfoxkid
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link
Owner

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

@eNNercY1337
Copy link
Contributor Author

eNNercY1337 commented Oct 29, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants