invert logic in AnimRef.Anim

This commit is contained in:
Josh Deprez 2021-08-12 04:45:23 +00:00
parent d612cf3e54
commit c6ead101bd

View file

@ -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
}
r.anim = &Anim{Def: ad}
return r.anim
}
// ImageRef loads images from the AssetFS into *ebiten.Image form.