magefree / magefree/mage

Interactions between Tokens and CommandObjects are very screwy

Open
#2,260 1 comment 0 reactions 0 assignees View on GitHub
refactoring
Dominant language
Java
Stars
2.4k
Forks
940
Avg merge
2d 12h
Merged PRs (30d)
160

Description

The problems go both ways:
- Tokens creating CommandObjects will lead to missing set symbols and possibly other problems
- CommandObjects creating tokens will lead to missing set symbols and possibly other problems

The core of the issue is that many places in the view code (and possibly engine code) erroneously do something like this:

```
Card source = game.getCard(something.someSourceId);
if (source != null) {
// Do stuff with source
} else {
// Incorrectly does nothing (or even worse, something it shouldn't) even
// though the source might exist and be a CommandObject or Token
}
```

I spotted at least 5 different places in the code where the issue exists, and there's presumably more. Solving this is not _too_ difficult, but it will be a headache to find _all_ of the relevant places where the mistake has been made, because it seems quite widespread.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.