clean up effects

This commit is contained in:
stryan 2021-10-07 12:46:59 -04:00
parent d47ec6e6de
commit dc117077af

View File

@ -25,15 +25,15 @@ func RemoveEffect(source uuid.UUID, c *Card) {
func AddEffect(c *Card, e *Effect) { func AddEffect(c *Card, e *Effect) {
if c.Type == EmptyValue { if c.Type == EmptyValue {
log.Println("Can't add effect to empty card") //can't apply effect to empty card
return return
} }
if c.Position < 0 { if c.Position < 0 || c.Position > 3 {
log.Println("trying to apply effect to card not on the board") log.Println("trying to apply effect to card not on the board")
} }
for _, v := range c.Effects { for _, v := range c.Effects {
if v.Owner == e.Owner && v.ID == e.ID && v.Target == e.Target { if v.Owner == e.Owner && v.ID == e.ID && v.Target == e.Target {
log.Println("can't stack effects") //can't stack effects
return return
} }
} }