-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update pb * point_viewcontrol * modelentity only * wip remove at control add fov changer fix compatibility with gamerules * finish feat disarm fix disable handle * fix: linux build * fix shutdown * fix view entity * skip bot * safe check * fix: crash with bot * think every tick * feat: ``EnableCameraAll`` / ``DisableCameraAll`` * update gamedata * Revert "update pb" This reverts commit 5c47f5f. --------- Co-authored-by: Alex <[email protected]>
- Loading branch information
Showing
19 changed files
with
597 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* ============================================================================= | ||
* CS2Fixes | ||
* Copyright (C) 2023-2024 Source2ZE | ||
* ============================================================================= | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, version 3.0, as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "../schema.h" | ||
#include "cbaseentity.h" | ||
#include "entity.h" | ||
|
||
/* logic_relay */ | ||
|
||
class CPointViewControl : public CBaseEntity | ||
{ | ||
DECLARE_SCHEMA_CLASS(CPointViewControl) | ||
|
||
// hello, don't port my garbage code to cssharp :) | ||
|
||
static constexpr int SF_POINT_VIEWCONTROL_FROZEN = 1 << 5; | ||
static constexpr int SF_POINT_VIEWCONTROL_FOV = 1 << 6; | ||
static constexpr int SF_POINT_VIEWCONTROL_DISARM = 1 << 7; | ||
|
||
public: | ||
[[nodiscard]] CBaseEntity* GetTargetCameraEntity() | ||
{ | ||
const auto pTarget = UTIL_FindEntityByName(nullptr, m_target().String()); | ||
return pTarget && pTarget->m_pCollision() ? pTarget : nullptr; | ||
} | ||
|
||
[[nodiscard]] bool HasTargetCameraEntity() | ||
{ | ||
return m_target().IsValid() && strlen(m_target().String()) >= 2; | ||
} | ||
|
||
[[nodiscard]] bool HasFrozen() | ||
{ | ||
return !!(m_spawnflags() & SF_POINT_VIEWCONTROL_FROZEN); | ||
} | ||
|
||
[[nodiscard]] bool HasFOV() | ||
{ | ||
return !!(m_spawnflags() & SF_POINT_VIEWCONTROL_FOV); | ||
} | ||
|
||
[[nodiscard]] bool HasDisarm() | ||
{ | ||
return !!(m_spawnflags() & SF_POINT_VIEWCONTROL_DISARM); | ||
} | ||
|
||
[[nodiscard]] uint GetFOV() | ||
{ | ||
return clamp(static_cast<uint>(m_iHealth()), 16, 179); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.