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 {
|
||||
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
|
||||
}
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue