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