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

Commit

Permalink
Merge pull request #7 from edgegamers/main
Browse files Browse the repository at this point in the history
dasd
  • Loading branch information
ntm5 authored Jul 11, 2024
2 parents e31188c + 772d65c commit de03ff1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
7 changes: 4 additions & 3 deletions mod/TTT.Logs/LogsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ public void Command_Logs(CCSPlayerController? executor, CommandInfo info)

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 @@ public void Command_Logs(CCSPlayerController? executor, CommandInfo info)
? 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()
}
}
}
}
}

0 comments on commit de03ff1

Please sign in to comment.