Skip to content

Commit

Permalink
chore: update hl2sdk (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmuffin authored Dec 27, 2023
1 parent 2f0d34b commit 8dbcb6d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SET(SOURCE_FILES
src/mm_plugin.h
libraries/hl2sdk-cs2/tier1/convar.cpp
libraries/hl2sdk-cs2/tier1/generichash.cpp
libraries/hl2sdk-cs2/entity2/entityidentity.cpp
libraries/hl2sdk-cs2/entity2/entitysystem.cpp
libraries/dotnet/hostfxr.h
libraries/dotnet/coreclr_delegates.h
Expand Down
2 changes: 1 addition & 1 deletion libraries/hl2sdk-cs2
13 changes: 6 additions & 7 deletions makefiles/shared.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
# TODO: Use C++20 instead.
set(CMAKE_CXX_STANDARD 17)

Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
if (LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()

set(CMAKE_STATIC_LIBRARY_PREFIX "")

set(SOURCESDK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libraries/hl2sdk-cs2)
Expand Down Expand Up @@ -51,8 +54,4 @@ include_directories(
libraries
)

include(${CMAKE_CURRENT_LIST_DIR}/metamod/configure_metamod.cmake)

if (LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/metamod/configure_metamod.cmake)
3 changes: 1 addition & 2 deletions managed/CounterStrikeSharp.API/Modules/Events/GameEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public void Set<T>(string name, T value)
SetInt(name, i);
break;
case var _ when value is CCSPlayerController player:
// When I was testing this, the code seems to expect a slot, even though it is called index
SetEntityIndex(name, (int)player.Index - 1);
NativeAPI.SetEventPlayerController(Handle, name, player.Handle);
break;
case var _ when value is string s:
SetString(name, s);
Expand Down
3 changes: 0 additions & 3 deletions src/core/managers/entity_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#include "entitysystem.h"
#include "scripting/callback_manager.h"

// variant.h depends on ivscript.h, lets not include the whole thing
DECLARE_POINTER_HANDLE(HSCRIPT);

#include <variant.h>

namespace counterstrikesharp {
Expand Down
6 changes: 5 additions & 1 deletion src/mm_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
#include "entity2/entitysystem.h"
#include "interfaces/cs2_interfaces.h"


counterstrikesharp::GlobalClass* counterstrikesharp::GlobalClass::head = nullptr;

CGameEntitySystem *GameEntitySystem()
{
return counterstrikesharp::globals::entitySystem;
}

// TODO: Workaround for windows, we __MUST__ have COUNTERSTRIKESHARP_API to handle it.
// like on windows it should be `extern "C" __declspec(dllexport)`, on linux it should be anything else.
DLL_EXPORT void InvokeNative(counterstrikesharp::fxNativeContext& context)
Expand Down

0 comments on commit 8dbcb6d

Please sign in to comment.