mirror of
https://github.com/MSWS/TTT.git
synced 2025-12-07 06:46:59 -08:00
Compare commits
19 Commits
1.4.0-dev.
...
2.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d9506a1cc | ||
|
|
d9f49473eb | ||
|
|
042c48c0a6 | ||
|
|
c2ada273a8 | ||
|
|
deb2e1cab2 | ||
|
|
dfe86b0242 | ||
|
|
c40c89b624 | ||
|
|
eff68897a0 | ||
|
|
63afe31e3b | ||
|
|
a7fa2afe15 | ||
|
|
1df2722ce7 | ||
|
|
7749deabd3 | ||
|
|
9079fe6c41 | ||
|
|
f8b67c5194 | ||
|
|
77281aa8c6 | ||
|
|
20497bbb4d | ||
|
|
2b04486e65 | ||
|
|
3b97c77065 | ||
|
|
83715fff1f |
@@ -34,8 +34,9 @@ public class GiveItemCommand(IServiceProvider provider) : ICommand {
|
||||
List<IOnlinePlayer> targets = [executor];
|
||||
|
||||
Server.NextWorldUpdateAsync(() => {
|
||||
var name = executor.Name;
|
||||
if (info.ArgCount == 3) targets = finder.GetMulti(info.Args[2], out name);
|
||||
var name = executor.Name;
|
||||
if (info.ArgCount == 3)
|
||||
targets = finder.GetMulti(info.Args[2], out name, executor);
|
||||
foreach (var player in targets) shop.GiveItem(player, item);
|
||||
|
||||
info.ReplySync($"Gave item '{item.Name}' to {name}.");
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SpecialRoundCommand(IServiceProvider provider) : ICommand {
|
||||
}
|
||||
|
||||
if (info.ArgCount == 1) {
|
||||
tracker.TryStartSpecialRound();
|
||||
Server.NextWorldUpdate(() => tracker.TryStartSpecialRound());
|
||||
info.ReplySync("Started a random special round.");
|
||||
return Task.FromResult(CommandResult.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class LowGravRound(IServiceProvider provider)
|
||||
var cvar = ConVar.Find("sv_gravity");
|
||||
if (cvar == null) return;
|
||||
|
||||
originalGravity = cvar.GetPrimitiveValue<int>();
|
||||
originalGravity = (int) Math.Round(cvar.GetPrimitiveValue<float>());
|
||||
var newGravity = (int)(originalGravity * config.GravityMultiplier);
|
||||
Server.NextWorldUpdate(()
|
||||
=> Server.ExecuteCommand($"sv_gravity {newGravity}"));
|
||||
|
||||
@@ -82,7 +82,7 @@ public class SpeedRound(IServiceProvider provider)
|
||||
public void OnDeath(PlayerDeathEvent ev) {
|
||||
var game = games.ActiveGame;
|
||||
if (game == null) return;
|
||||
if (Tracker.ActiveRounds.Contains(this)) return;
|
||||
if (!Tracker.ActiveRounds.Contains(this)) return;
|
||||
|
||||
var victimRoles = roles.GetRoles(ev.Victim);
|
||||
if (!victimRoles.Any(r => r is InnocentRole)) return;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class VanillaRound(IServiceProvider provider)
|
||||
[UsedImplicitly]
|
||||
[EventHandler(Priority = Priority.HIGH)]
|
||||
public void OnPurchase(PlayerPurchaseItemEvent ev) {
|
||||
if (Tracker.ActiveRounds.Contains(this)) return;
|
||||
if (!Tracker.ActiveRounds.Contains(this)) return;
|
||||
ev.IsCanceled = true;
|
||||
|
||||
messenger.Message(ev.Player, locale[RoundMsgs.VANILLA_ROUND_REMINDER]);
|
||||
|
||||
@@ -86,8 +86,7 @@ public class SpecialRoundStarter(IServiceProvider provider)
|
||||
var rounds = Provider.GetServices<ITerrorModule>()
|
||||
.OfType<AbstractSpecialRound>()
|
||||
.Where(r => r.Config.Weight > 0 && !exclude.Contains(r))
|
||||
.Where(r
|
||||
=> !exclude.Any(er => er.ConflictsWith(r) && !r.ConflictsWith(er)))
|
||||
.Where(r => !exclude.Any(er => er.ConflictsWith(r) || r.ConflictsWith(er)))
|
||||
.ToList();
|
||||
if (rounds.Count == 0) return null;
|
||||
var totalWeight = rounds.Sum(r => r.Config.Weight);
|
||||
|
||||
Reference in New Issue
Block a user