I'm currently attempting to try and filter an actor's available weapons by those that match a variable wtypeId, but all I've been getting so far are errors, and the syntax looks correct. The relevant code is below:
Game_Actor.prototype.activateBestType = function(wtypeId1, wtypeid2){
var weapons = this.weapons().filter(function(wpn) { return wpn.wtypeId === wtypeId1 || wpn.wtypeId === wtypeId2; });
...
};
(Note that the weapons() function already filters out null values, so it'd be redundant to include it above.)
Game_Actor.prototype.activateBestType = function(wtypeId1, wtypeid2){
var weapons = this.weapons().filter(function(wpn) { return wpn.wtypeId === wtypeId1 || wpn.wtypeId === wtypeId2; });
...
};
(Note that the weapons() function already filters out null values, so it'd be redundant to include it above.)