mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-27 22:18:03 +03:00
Add trace log for a particular case.
Enable RTTI
This commit is contained in:
parent
60b6cf9160
commit
7064fa31e2
@ -119,7 +119,7 @@ void setupToolchain(NativeBinarySpec b)
|
|||||||
cfg.compilerOptions.enhancedInstructionsSet = EnhancedInstructionsSet.DISABLED
|
cfg.compilerOptions.enhancedInstructionsSet = EnhancedInstructionsSet.DISABLED
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cfg.compilerOptions.args '/Oi', '/GF', '/GS-', '/GR-'
|
cfg.compilerOptions.args '/Oi', '/GF', '/GS-'
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.projectLibpath(project, '/lib')
|
cfg.projectLibpath(project, '/lib')
|
||||||
|
@ -1438,6 +1438,28 @@ void OnFreeEntPrivateData(edict_t *pEnt)
|
|||||||
if (!pEntity)
|
if (!pEntity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||||
|
{
|
||||||
|
CBasePlayer *pPlayer = UTIL_PlayerByIndex(i);
|
||||||
|
|
||||||
|
if (!pPlayer)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (FNullEnt(pPlayer->edict()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pPlayer->IsDormant())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pPlayer->m_pActiveItem && pPlayer->m_pActiveItem == pEntity)
|
||||||
|
{
|
||||||
|
ALERT(at_warning, "Trying to release the entity: (%s : `%s`) without pre-reset m_pActiveItem\n", pEntity->GetClassname(), pEntity->pev->model.str());
|
||||||
|
pPlayer->m_pActiveItem = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef REGAMEDLL_API
|
#ifdef REGAMEDLL_API
|
||||||
pEntity->OnDestroy();
|
pEntity->OnDestroy();
|
||||||
#endif
|
#endif
|
||||||
|
@ -4610,8 +4610,19 @@ int EXT_FUNC GetWeaponData(edict_t *pEdict, struct weapon_data_s *info)
|
|||||||
auto pPlayerItem = pPlayer->m_rgpPlayerItems[i];
|
auto pPlayerItem = pPlayer->m_rgpPlayerItems[i];
|
||||||
while (pPlayerItem)
|
while (pPlayerItem)
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Make sure that entity is CBasePlayerItem
|
||||||
|
auto pItem = dynamic_cast<CBasePlayerItem *>(pPlayerItem);
|
||||||
|
if (pItem = nullptr)
|
||||||
|
{
|
||||||
|
ALERT(at_error, "GetWeaponData: m_rgpPlayerItems[%i] is non-item, entity: (%s `%s`), (%s)\n", i, pPlayerItem->GetClassname(), pPlayerItem->pev->model.str(), typeid(pPlayer->m_pActiveItem).name());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// there's a weapon here. Should I pack it?
|
// there's a weapon here. Should I pack it?
|
||||||
auto weapon = (CBasePlayerWeapon *)pPlayerItem->GetWeaponPtr();
|
auto weapon = (CBasePlayerWeapon *)pPlayerItem->GetWeaponPtr();
|
||||||
|
|
||||||
if (weapon && weapon->UseDecrement())
|
if (weapon && weapon->UseDecrement())
|
||||||
{
|
{
|
||||||
// Get The ID
|
// Get The ID
|
||||||
@ -4749,6 +4760,16 @@ void EXT_FUNC UpdateClientData(const edict_t *ent, int sendweapons, struct clien
|
|||||||
ItemInfo II;
|
ItemInfo II;
|
||||||
Q_memset(&II, 0, sizeof(II));
|
Q_memset(&II, 0, sizeof(II));
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Make sure that entity is CBasePlayerItem
|
||||||
|
auto pItem = dynamic_cast<CBasePlayerItem *>(pPlayer->m_pActiveItem);
|
||||||
|
if (pItem = nullptr)
|
||||||
|
{
|
||||||
|
ALERT(at_error, "GetWeaponData: m_pActiveItem is non-item, entity: (%s `%s`), (%s)\n", pPlayer->m_pActiveItem->GetClassname(), pPlayer->m_pActiveItem->pev->model.str(), typeid(pPlayer->m_pActiveItem).name());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CBasePlayerWeapon *weapon = (CBasePlayerWeapon *)pPlayer->m_pActiveItem->GetWeaponPtr();
|
CBasePlayerWeapon *weapon = (CBasePlayerWeapon *)pPlayer->m_pActiveItem->GetWeaponPtr();
|
||||||
if (weapon && weapon->UseDecrement() && weapon->GetItemInfo(&II))
|
if (weapon && weapon->UseDecrement() && weapon->GetItemInfo(&II))
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <typeinfo>
|
||||||
|
|
||||||
// custom enum
|
// custom enum
|
||||||
enum ChooseTeamMenuSlot
|
enum ChooseTeamMenuSlot
|
||||||
{
|
{
|
||||||
|
@ -911,6 +911,7 @@
|
|||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -953,6 +954,7 @@
|
|||||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -998,6 +1000,7 @@
|
|||||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -1037,6 +1040,7 @@
|
|||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -1072,6 +1076,7 @@
|
|||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user