Ok guys. I am creating a mutator that checks what weapon a player is holding when they spawn and if they are holding the weapon I want to replace, it swaps it out for the new weapon I've created. Only problem is, it won't compile. It gives me a Type mismatch in '='
Here's the code:
If you are wondering why I am trying to do this with Checkreplacement(), the particular situation (immediately on/after player spawn) this is to be used in doesn't warrant any other method AFAIK.
Any help would be greatly appreciated!
Here's the code:
Code:
class WeaponReplaceMutator extends Mutator; var class<Weapon> OldWeaponClass, NewWeaponClass; function bool CheckReplacement(actor Other, out byte bSuperRelevant) { if ( Pawn(Other) != None ) { if ( Pawn(Other).Weapon == OldWeaponClass ) { Pawn(Other).Weapon = NewWeaponClass; } else return true; } return true; } defaultproperties { OldWeaponClass=class'oldpackage.oldweaponclass' NewWeaponClass=class'newpackage.newweaponclass' }
Any help would be greatly appreciated!
Comment