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

Commit

Permalink
Revert "Add debug command"
Browse files Browse the repository at this point in the history
This reverts commit ba5ab55, reversing
changes made to 9410c67.
  • Loading branch information
MSWS committed Jul 20, 2024
1 parent ba5ab55 commit c1b5779
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 136 deletions.
7 changes: 0 additions & 7 deletions TTT.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TTT.Player", "mod\TTT.Playe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TTT.Manager", "mod\TTT.Manager\TTT.Manager.csproj", "{C3C26EF9-0E5E-4AAF-AE00-EFF4BB129FDB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TTT.Debug", "mod\TTT.Debug\TTT.Debug.csproj", "{5617C94C-B2F9-429C-B4C1-DDD03380A108}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -86,10 +84,6 @@ Global
{C3C26EF9-0E5E-4AAF-AE00-EFF4BB129FDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3C26EF9-0E5E-4AAF-AE00-EFF4BB129FDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3C26EF9-0E5E-4AAF-AE00-EFF4BB129FDB}.Release|Any CPU.Build.0 = Release|Any CPU
{5617C94C-B2F9-429C-B4C1-DDD03380A108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5617C94C-B2F9-429C-B4C1-DDD03380A108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5617C94C-B2F9-429C-B4C1-DDD03380A108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5617C94C-B2F9-429C-B4C1-DDD03380A108}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A917B0F5-762F-4C4A-9F50-02BA4A0C6B63} = {C7CCF187-9F99-4091-B092-6397C35BE9F1}
Expand All @@ -103,6 +97,5 @@ Global
{E76CD078-0F1B-4EE8-9A19-EE93BAE3FA6B} = {14FF3D75-F9CF-4A32-9F59-83765EA68874}
{D9327D60-67EE-4AF3-BD99-8A95634600B5} = {14FF3D75-F9CF-4A32-9F59-83765EA68874}
{C3C26EF9-0E5E-4AAF-AE00-EFF4BB129FDB} = {14FF3D75-F9CF-4A32-9F59-83765EA68874}
{5617C94C-B2F9-429C-B4C1-DDD03380A108} = {14FF3D75-F9CF-4A32-9F59-83765EA68874}
EndGlobalSection
EndGlobal
30 changes: 0 additions & 30 deletions mod/TTT.Debug/Commands/GetRagdoll.cs

This file was deleted.

11 changes: 0 additions & 11 deletions mod/TTT.Debug/DebugServiceExtension.cs

This file was deleted.

17 changes: 0 additions & 17 deletions mod/TTT.Debug/TTT.Debug.csproj

This file was deleted.

14 changes: 11 additions & 3 deletions mod/TTT.Detective/DetectiveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class DetectiveManager(IPlayerService roleService)
public void Start(BasePlugin parent) {
parent.RegisterListener<Listeners.OnTick>(() => {
foreach (var player in Utilities.GetPlayers()
.Where(player => player.IsValid && player.IsReal())
.Where(player => (player.Buttons & PlayerButtons.Use) != 0))
OnPlayerUse(player);
});
Expand Down Expand Up @@ -62,11 +63,15 @@ public HookResult OnZeus(DynamicHook hook) {
private void OnPlayerUse(CCSPlayerController player) { IdentifyBody(player); }

private void IdentifyBody(CCSPlayerController caller) {
// if (roleService.GetPlayer(caller).PlayerRole() != Role.Detective) return;
//add states

if (roleService.GetPlayer(caller).PlayerRole() != Role.Detective) return;

var entity = caller.GetClientRagdollAimTarget();

if (entity == null || !entity.PawnIsAlive) return;
if (entity == null) return;

if (entity.PawnIsAlive) return;

var player = roleService.GetPlayer(entity);

Expand All @@ -90,6 +95,7 @@ private void IdentifyBody(CCSPlayerController caller) {
.PlayerRole()
.FormatStringFullAfter(killerEntity.PlayerName));


player.SetFound(true);

Server.NextFrame(() => { Server.PrintToChatAll(message); });
Expand All @@ -111,7 +117,9 @@ private void IdentifyBody(CCSPlayerController caller) {
if (player_pawn == null || !player_pawn.IsValid) return null;

// controller valid
if (player_pawn.OriginalController is not { IsValid: true }) return null;
if (player_pawn.OriginalController == null
|| !player_pawn.OriginalController.IsValid)
return null;

// any further validity is up to the caller
return player_pawn.OriginalController.Value;
Expand Down
Loading

0 comments on commit c1b5779

Please sign in to comment.