News:

Come Chat with us live! Learn how HERE!

Main Menu

New secondary attack is invisible

Started by rotacak, October 27, 2009, 11:43:19 PM

rotacak

Hi, I added secondary attack to pulse rifle and when I shoot I saw no bullets and hear no sound. But bullets are really there, I can destroy structures etc. with invisible bullets.

If I will change in g_active.c this:
      case EV_FIRE_WEAPON:
        FireWeapon( ent );
        break;

      case EV_FIRE_WEAPON2:
        FireWeapon2( ent );
        break;


to this:

      case EV_FIRE_WEAPON:
        FireWeapon( ent );
        break;

      case EV_FIRE_WEAPON2:
        FireWeapon( ent );
        break;


then first and second attack should be same, but second is invisible and without sound. Why?

gimhael

The "special effects" are generated on the client side, and the client checks the weaponMode, which is still WPM_SECONDARY even if you call FireWeapon() instead of FireWeapon2().

I think a working dirty fix is to add "m->s.generic1 = WPM_PRIMARY;" at the end of pulseRifleFire().

The proper way would be to alter the weapon.cfg of the pulse rifle, but ofc this requires a pk3 download.

rotacak

Thanx alot. That hack works, bullets are visible, but sound still missing. When I changed weapon.cfg all is ok. Once again, thanx!