invert logic in AnimRef.Anim
This commit is contained in:
parent
d612cf3e54
commit
c6ead101bd
1 changed files with 6 additions and 5 deletions
|
@ -30,12 +30,13 @@ func (r *AnimRef) Anim() *Anim {
|
||||||
if r.anim != nil {
|
if r.anim != nil {
|
||||||
return r.anim
|
return r.anim
|
||||||
}
|
}
|
||||||
if ad := AnimDefs[r.Key]; ad != nil {
|
ad := AnimDefs[r.Key]
|
||||||
r.anim = &Anim{Def: ad}
|
if ad == nil {
|
||||||
return r.anim
|
log.Fatalf("Unknown AnimDef %q", r.Key)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
log.Fatalf("Unknown AnimDef %q", r.Key)
|
r.anim = &Anim{Def: ad}
|
||||||
return nil
|
return r.anim
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageRef loads images from the AssetFS into *ebiten.Image form.
|
// ImageRef loads images from the AssetFS into *ebiten.Image form.
|
||||||
|
|
Loading…
Reference in a new issue