-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5f2f8d
commit e8a0c03
Showing
4 changed files
with
44 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include <CS2/Classes/CCSPlayer_HostageServices.h> | ||
#include "EntitySystem.h" | ||
|
||
template <typename HookContext> | ||
class HostageServices { | ||
public: | ||
HostageServices(HookContext& hookContext, cs2::CCSPlayer_HostageServices* hostageServices) noexcept | ||
: hookContext{hookContext} | ||
, hostageServices{hostageServices} | ||
{ | ||
} | ||
|
||
[[nodiscard]] bool hasCarriedHostage() const noexcept | ||
{ | ||
return hookContext.template make<EntitySystem>().getEntityFromHandle(deps().offsetToCarriedHostage.of(hostageServices).valueOr(cs2::CEntityHandle{cs2::INVALID_EHANDLE_INDEX})) != nullptr; | ||
} | ||
|
||
private: | ||
[[nodiscard]] const auto& deps() const noexcept | ||
{ | ||
return hookContext.gameDependencies().hostageServicesDeps; | ||
} | ||
|
||
HookContext& hookContext; | ||
cs2::CCSPlayer_HostageServices* hostageServices; | ||
}; |
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