aboutsummaryrefslogtreecommitdiff
path: root/go/game/effect.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-09-05 18:30:05 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-09-05 18:33:35 +0200
commit04476b3225158a244269a84f0dcf112cfd0ee05a (patch)
treeae75061a5e87b6389e1c562f2a8066e998fdc385 /go/game/effect.go
parent034e176110cc0a27cd20bdfe8522fd0dc73d2346 (diff)
downloadmuhqs-game-04476b3225158a244269a84f0dcf112cfd0ee05a.tar.gz
muhqs-game-04476b3225158a244269a84f0dcf112cfd0ee05a.zip
fix that granting effects are considered x effects
X effects have to start with the X value or the keyword.
Diffstat (limited to 'go/game/effect.go')
-rw-r--r--go/game/effect.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/go/game/effect.go b/go/game/effect.go
index 3b96082e..f2482f96 100644
--- a/go/game/effect.go
+++ b/go/game/effect.go
@@ -87,8 +87,8 @@ func (e ErrXEffectError) Error() string {
var ErrXEffectFormat = ErrXEffectError{errors.New("invalid format")}
var (
- xEffectXSuffix = regexp.MustCompile(`\S+ ([\+-]?)(\d+)`)
- xEffectXPrefix = regexp.MustCompile(`([\+-]?)(\d+) \S+`)
+ xEffectXSuffix = regexp.MustCompile(`^\S+ ([\+-]?)(\d+)`)
+ xEffectXPrefix = regexp.MustCompile(`^([\+-]?)(\d+) \S+`)
)
func parseXEffect(desc string) (e xEffect, err error) {