Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复: EconomicsAPI 进度取反无效 #337

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EconomicsAPI/Economics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Economics : TerrariaPlugin

public override string Name => Assembly.GetExecutingAssembly().GetName().Name!;

public override Version Version => new(1, 0, 0, 6);
public override Version Version => new(1, 0, 0, 7);

public readonly static List<TSPlayer> ServerPlayers = new();

Expand Down
8 changes: 6 additions & 2 deletions EconomicsAPI/Extensions/GameProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ public static Dictionary<string, bool> GetProgress(this TSPlayer Player)

public static bool InProgress(this TSPlayer Player, IEnumerable<string> names)
{
var anti = false;
var gameProgress = Player.GetProgress();
foreach (var name in names)
{
var anti = false;
var pn = name;
if (name.StartsWith('!'))
{
anti = true;
if (gameProgress.TryGetValue(name, out var code))
pn = name[1..];
}
if (gameProgress.TryGetValue(pn, out var code))
if (code == anti)
return false;
}
Expand Down
Loading