Author Topic: New secondary attack is invisible  (Read 3125 times)

rotacak

  • Posts: 761
  • Turrets: +39/-64
New secondary attack is invisible
« on: October 28, 2009, 12:43:19 am »
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:
Code: [Select]
      case EV_FIRE_WEAPON:
        FireWeapon( ent );
        break;

      case EV_FIRE_WEAPON2:
        FireWeapon2( ent );
        break;

to this:

Code: [Select]
      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

  • Posts: 546
  • Turrets: +70/-16
Re: New secondary attack is invisible
« Reply #1 on: October 28, 2009, 12:58:11 pm »
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

  • Posts: 761
  • Turrets: +39/-64
Re: New secondary attack is invisible
« Reply #2 on: October 28, 2009, 05:44:26 pm »
Thanx alot. That hack works, bullets are visible, but sound still missing. When I changed weapon.cfg all is ok. Once again, thanx!