s1lentq / reapi

AMX Mod X module, using API regamedll & rehlds
GNU General Public License v3.0
160 stars 103 forks source link

`API`: Implement `RG_CBasePlayerWeapon_KickBack` hook #253

Closed ShadowsAdi closed 1 year ago

ShadowsAdi commented 2 years ago

Related to: https://github.com/s1lentq/reapi/issues/153

RauliTop commented 2 years ago

Add a description to include please

RauliTop commented 2 years ago

That description is not true, kickback is the recoil of weapon.

A description example could be: called when attacker fires a weapon. Used to change weapon's recoil.

Also, the issue you mention is about create a native. Not the hook

ShadowsAdi commented 2 years ago

That description is not true, kickback is the recoil of weapon.

A description example could be: called when attacker fires a weapon. Used to change weapon's recoil.

Also, the issue you mention is about create a native. Not the hook

KickBack is not the recoil of the weapon. The recoil of a weapon is it's punchangles.

See https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/dlls/wpn_shared/wpn_ak47.cpp#L156-L172. Weapons which have a KickBack in GameDLL: AK47, AUG, FAMAS, GALIL, M249, M4A1, MAC10, MP5NAVY, P90, SG552, TMP, UMP45

RauliTop commented 2 years ago

KickBack is not the recoil of the weapon. The recoil of a weapon is it's punchangles.

See https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/dlls/wpn_shared/wpn_ak47.cpp#L156-L172. Weapons which have a KickBack in GameDLL: AK47, AUG, FAMAS, GALIL, M249, M4A1, MAC10, MP5NAVY, P90, SG552, TMP, UMP45

You just gave me the reason.

punchangles are being changed at Kickback. So, Kickback is what I said, the weapon's recoil. https://github.com/s1lentq/ReGameDLL_CS/blob/67cc153f5d0abab1e42b32a83ef4a470c8781a5c/regamedll/dlls/weapons.cpp#L692-L734

RauliTop commented 2 years ago

Called when a weapon bullet knocks an enemy. You are confusing kickback to knockback: https://github.com/s1lentq/ReGameDLL_CS/blob/f050be77db474e45c2f525c396f30e33a48e8186/regamedll/dlls/player.cpp#L1144-L1152

ShadowsAdi commented 2 years ago

Called when a weapon bullet knocks an enemy. You are confusing kickback to knockback: https://github.com/s1lentq/ReGameDLL_CS/blob/f050be77db474e45c2f525c396f30e33a48e8186/regamedll/dlls/player.cpp#L1144-L1152

Yes, you're right. Gotta change the description.

RauliTop commented 2 years ago

punchangles on Victim are changed at TraceAttack: https://github.com/s1lentq/ReGameDLL_CS/blob/f050be77db474e45c2f525c396f30e33a48e8186/regamedll/dlls/player.cpp#L641-L719

RauliTop commented 2 years ago

Now is great!

Time to create the native rg_kickback?

ShadowsAdi commented 2 years ago

Now is great!

Time to create the native rg_kickback?

After the RG hook will be implemented, I will take some time to make this too.

s1lentq commented 1 year ago

Done #280