tweaks
This commit is contained in:
parent
300b9a1c3d
commit
26345f7d71
2 changed files with 2 additions and 5 deletions
|
@ -79,10 +79,7 @@ func (g *Game) updateRecursive(c interface{}) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c == g { // prevent infinite recursion
|
if u, ok := c.(Updater); ok && c != g {
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if u, ok := c.(Updater); ok {
|
|
||||||
return u.Update()
|
return u.Update()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -161,7 +161,7 @@ type Transformer interface {
|
||||||
|
|
||||||
// Updater components can update themselves. Update is called repeatedly. Each
|
// Updater components can update themselves. Update is called repeatedly. Each
|
||||||
// component must call Update on any internal components not known to the engine
|
// component must call Update on any internal components not known to the engine
|
||||||
// (i.e. not passed to Game.Register or returned from Scan).
|
// (i.e. not passed to Game.Register or returned from Scan).
|
||||||
type Updater interface {
|
type Updater interface {
|
||||||
Update() error
|
Update() error
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue