I am here to report a bug in Yanfly's Job Points plugin (Yep_JobPoints.js).
So, the bug is that if an enemy gives you job points if you defeat it (by writing <JP: x> on the enemy's note), it won't happen if an actor takes their turns (or just attacks it). If the enemy is defeated, whereas an actor still needs to get their turn, they earn JP points from the party defeating all the enemies.
I have looked at the code and saw that what happens is that the actor's GainJP method gets called and passed a NaN. They get passed this from this code:
If I comment on the last line of code, the issue will not happen. I personally can't fix this issue. But at least commenting out the last line of code here removes this specific bug since my items don't give out JP points.
So, the bug is that if an enemy gives you job points if you defeat it (by writing <JP: x> on the enemy's note), it won't happen if an actor takes their turns (or just attacks it). If the enemy is defeated, whereas an actor still needs to get their turn, they earn JP points from the party defeating all the enemies.
I have looked at the code and saw that what happens is that the actor's GainJP method gets called and passed a NaN. They get passed this from this code:
Code:
Yanfly.JP.Game_Battler_useItem = Game_Battler.prototype.useItem;
Game_Battler.prototype.useItem = function(item) {
Yanfly.JP.Game_Battler_useItem.call(this, item);
if (!$gameParty.inBattle()) return;
if (this.isActor()) this.gainJp(eval(item.gainJp), this.currentClass().id);
};
If I comment on the last line of code, the issue will not happen. I personally can't fix this issue. But at least commenting out the last line of code here removes this specific bug since my items don't give out JP points.