Tripwire Interactive Forums

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
HOWTO-Replace 9mm given back from trader

If you sell your custom class that extends Dualies or DualDeagle, the trader will give you back a...9mm or Deagle, regardless of what your non-dual class is. The culprit is in KFPawn. You will need to handle this somehow if you want to subclass Dualies or DualDeagle and don't want the aforementioned behavior. Here's one way to handle it that has seemed to work ok on my dedicated server during testing.

Inside a mutator's CheckReplace()...
Code:
    //hack fix for the machinedualies trader issue...
    if ( Other.Class==Class'Single' )
    {
        KFHP = KFHumanPawn(Single(Other).Instigator);
        if (KFHP != None)
        {
            Other.Destroy();
            NineMMReplacement = Spawn(class'WTFEquipMachinePistol');
            NineMMReplacement.GiveTo(KFHP);
            return false;
        }
    }