Hello the community.
I'm currently working on a passive states plugins. I have noted some minor slow-downs with it on my old computer when a battler is affected by lots of states which suppose that there is room for some improvement.
I was wondering if this type of optimization was safe (I mean, can it create conflicts with MV's base code?):
var _Game_BattlerBase_prototype_states = Game_BattlerBase.prototype.states;
Game_BattlerBase.prototype.states = function() {
if (this._statesCache !== undefined) return this._statesCache;
this._statesCache =_Game_BattlerBase_prototype_states.call(this);
this.addPassivesStates(this._statesCache);
return this._statesCache;
};
var _Game_BattlerBase_prototype_refresh = Game_BattlerBase.prototype.refresh;
Game_BattlerBase.prototype.refresh = function() {
this._statesCache = undefined;
_Game_BattlerBase_prototype_refresh.call(this);
};
I'm currently working on a passive states plugins. I have noted some minor slow-downs with it on my old computer when a battler is affected by lots of states which suppose that there is room for some improvement.
I was wondering if this type of optimization was safe (I mean, can it create conflicts with MV's base code?):
var _Game_BattlerBase_prototype_states = Game_BattlerBase.prototype.states;
Game_BattlerBase.prototype.states = function() {
if (this._statesCache !== undefined) return this._statesCache;
this._statesCache =_Game_BattlerBase_prototype_states.call(this);
this.addPassivesStates(this._statesCache);
return this._statesCache;
};
var _Game_BattlerBase_prototype_refresh = Game_BattlerBase.prototype.refresh;
Game_BattlerBase.prototype.refresh = function() {
this._statesCache = undefined;
_Game_BattlerBase_prototype_refresh.call(this);
};