[RMMV] MY GETTERS DON'T WORK AS THEY SHOULD.

Posts

Pages: 1
I created a class that inherited from another. When I use one of the getters it has (not inherited from the parent), it returns the default value of the backing field. But when I directly access the backing field, it returns the value it was last assigned (this should also happen using the getter).

Here's some of my code:
// Backing fields.
_damageMitigation: -1,
_protectorsNeeded: -1,

// Getters.
get damageMitigation() { return this._damageMitigation; },
get protectorsNeeded() { return this._protectorsNeeded; },
Why does this happen?

Pages: 1