X-12 / andromeda

0 stars 0 forks source link

TypeError: this.set is not a function (part two) #134

Closed jextrevor closed 7 years ago

jextrevor commented 7 years ago

When a system executes callbacks as a result of a value being set, it passes the wrong context of "this" to the callback function (at least, that's what I think is happening).

In all callback functions, instead of calling using this, use Ship.XXXXXX.

e.g.

healthChanged(){
    if(Ship.Health.Radar < Ship.Defaults.Radar.minhealth){
        Ship.Radar.set("objects",{}) //instead of this.set
    }
}
jextrevor commented 7 years ago

This is gonna take a little bit of work to convert all references to "this" in callback functions to "Ship.whatever" references.

jextrevor commented 7 years ago

I'm going to tackle this one right now