Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

dasd #7

Merged
merged 6 commits into from
Jul 11, 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
7 changes: 4 additions & 3 deletions mod/TTT.Logs/LogsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class LogsCommand(ILogService service) : IPluginBehavior
{
private readonly ILogService _service = service;

Check warning on line 13 in mod/TTT.Logs/LogsCommand.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'ILogService service' is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.

Check warning on line 13 in mod/TTT.Logs/LogsCommand.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'ILogService service' is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.

Check warning on line 13 in mod/TTT.Logs/LogsCommand.cs

View workflow job for this annotation

GitHub Actions / publish

Parameter 'ILogService service' is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.

Check warning on line 13 in mod/TTT.Logs/LogsCommand.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'ILogService service' is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.

public void Start(BasePlugin plugin)
{
Expand All @@ -32,15 +32,16 @@

var roundId = service.GetCurrentRound();

if (!string.IsNullOrEmpty(roundIdString) || !int.TryParse(roundIdString, out roundId))
if (string.IsNullOrEmpty(roundIdString) && !int.TryParse(roundIdString, out roundId))
{
info.ReplyToCommand(StringUtils.FormatTTT("Invalid round id"));
info.ReplyToCommand(StringUtils.FormatTTT("Invalid round id, /logs <roundId>"));
return;
}

if (roundId <= 0)
{
info.ReplyToCommand( StringUtils.FormatTTT("Invalid round id"));
return;
}

if (executor == null)
Expand All @@ -59,4 +60,4 @@
? StringUtils.FormatTTT("No logs found for round " + roundId)
: StringUtils.FormatTTT("Logs printed to console"));
}
}
}
4 changes: 1 addition & 3 deletions mod/TTT.Roles/RoleBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public HookResult OnRoundStart(EventRoundFreezeEnd @event, GameEventInfo info)
if (!string.IsNullOrEmpty(string.Empty))
player.GiveNamedItem(string.Empty);

player.GiveNamedItem("weapon_glock");
player.GiveNamedItem("weapon_knife");
service.GetPlayer(player).ModifyKarma();
}

Expand Down Expand Up @@ -107,8 +107,6 @@ public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)

if (_traitorsLeft == 0 || _innocentsLeft == 0) Server.NextFrame(() => _roundService.ForceEnd());

Server.NextFrame(() => playerWhoWasDamaged.CommitSuicide(false, true));

Server.NextFrame(() =>
{
Server.PrintToChatAll(
Expand Down
6 changes: 3 additions & 3 deletions mod/TTT.Round/Round.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public class Round
{
private readonly IRoleService _roleService;
private readonly RoundConfig? _config;
private float _graceTime = 20;
private float _graceTime = 20 * 64;
private readonly int _roundId;

public Round(IRoleService roleService, RoundConfig? config, int roundId)
{
_roleService = roleService;
_config = config;
_graceTime = 20;
_graceTime = 20 * 64;
_roundId = roundId;
}

Expand Down Expand Up @@ -103,4 +103,4 @@ private void SendDetectiveMessage()
}
}
}
}
}
Loading