Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Debido on August 29, 2014, 05:22:41 AM

Title: EveryFrameWeaponEffectPlugin - Refit Menu Check
Post by: Debido on August 29, 2014, 05:22:41 AM
For future reference, when you get NPEs and other bugs in the refit menu with an EveryFrameWeaponEffectPlugin. You can check if weapon.getShip().getOriginalOwner() == -1

If this is true, then you're in the refit menu.

        if (weapon.getShip().getOriginalOwner() == -1){
            return;
        }
Title: Re: EveryFrameWeaponEffectPlugin - Refit Menu Check
Post by: Sundog on August 29, 2014, 12:51:26 PM
Yes! This should allow me to fix a long-standing bug in my faction. Many thanks  :D
How'd you figure this out?
Title: Re: EveryFrameWeaponEffectPlugin - Refit Menu Check
Post by: Debido on August 29, 2014, 06:20:44 PM
I was getting a NPE in the refit menu. So I attached a NetBeans debugger to the crashing EveryFrameWeaponEffectPlugin, and was looking at the variables and noticed that value when looking for possible null values. I thought it could be useful to others experiencing similar issues.
Title: Re: EveryFrameWeaponEffectPlugin - Refit Menu Check
Post by: Sundog on August 29, 2014, 07:11:41 PM
Well you were right  :)
Title: Re: EveryFrameWeaponEffectPlugin - Refit Menu Check
Post by: Tecrys on August 30, 2014, 01:05:59 PM
It's great that you were able to find that out, now my edited version of the weapon mirroring script could be fixed and that would make left and right variants of my melee weapons obsolete.