Quote:
Originally Posted by DJEarthQuake
Nice. Welcome. Put it before SetHamParamFloat.
if(!has_fired_whatever(attacker)) SetHamParamFloat...
|
Is this how the code shouuld look like? Red code is the bugfix code:
Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, dmg_bits)
{
if (!is_user_alive(attacker))
return HAM_IGNORED;
if (!g_has_plasmagun[attacker])
return HAM_IGNORED;
if (get_user_weapon(attacker) != CSW_AUG)
return HAM_IGNORED;
if(!has_fired_plasmagun(attacker))
SetHamParamFloat(OFFSET_LINUX_WEAPONS, damage * get_pcvar_float(cvar_plasmagun_damage));
return HAM_IGNORED;
}
bool:has_fired_plasmagun(attacker)
{
new fired_plasmagun = find_ent(-1,"info_plasmagun")
return pev(fired_plasmagun, pev_owner) != attacker ? false : true
}
I added "if(!has_fired_plasmagun(attacker))" where you told me to add it - now the compiler doen't produce any errors or warnings. However, the bugfix doesn't work. The jetpack rocket's damage is still influenced when you fire the rocket and switch to PlasmaGun before the rocket hit a zombie.
Any ideas how to fix this bug?
Shouldn't we try to edit the jetpack code, and add bugfixes there, instead of adding bugfixes in every extra item (weapon) one by one? Is there a way to edit the jetpack code in a way the jetpack rocket's damage to not be influenced by other weapons when you switch to other weapons after you fire the rocket but you switch to other weapons before the rocket hit a zombie?
Or, maybe the bugfix works, but i didn't add it correctly? Didn't i add the bugfix in the way you told me to add it?