mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 23:58:06 +03:00
parent
6fc1c2ff84
commit
15328fd764
@ -1,3 +1,3 @@
|
|||||||
majorVersion=5
|
majorVersion=5
|
||||||
minorVersion=19
|
minorVersion=20
|
||||||
maintenanceVersion=0
|
maintenanceVersion=0
|
||||||
|
@ -38,6 +38,10 @@ const char *EXT_FUNC Cmd_Argv_api(int i) {
|
|||||||
return CMD_ARGV_(i);
|
return CMD_ARGV_(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGrenade *PlantBomb_api(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity) {
|
||||||
|
return CGrenade::ShootSatchelCharge(pevOwner, vecStart, vecVelocity);
|
||||||
|
}
|
||||||
|
|
||||||
ReGameFuncs_t g_ReGameApiFuncs = {
|
ReGameFuncs_t g_ReGameApiFuncs = {
|
||||||
&CREATE_NAMED_ENTITY,
|
&CREATE_NAMED_ENTITY,
|
||||||
|
|
||||||
@ -54,7 +58,9 @@ ReGameFuncs_t g_ReGameApiFuncs = {
|
|||||||
&RemoveEntityHashValue,
|
&RemoveEntityHashValue,
|
||||||
|
|
||||||
Cmd_Argc_api,
|
Cmd_Argc_api,
|
||||||
Cmd_Argv_api
|
Cmd_Argv_api,
|
||||||
|
|
||||||
|
PlantBomb_api
|
||||||
};
|
};
|
||||||
|
|
||||||
GAMEHOOK_REGISTRY(CBasePlayer_Spawn);
|
GAMEHOOK_REGISTRY(CBasePlayer_Spawn);
|
||||||
|
@ -1202,7 +1202,11 @@ CGrenade *CGrenade::__API_HOOK(ShootSatchelCharge)(entvars_t *pevOwner, VectorRe
|
|||||||
UTIL_SetOrigin(pGrenade->pev, vecStart);
|
UTIL_SetOrigin(pGrenade->pev, vecStart);
|
||||||
pGrenade->pev->velocity = g_vecZero;
|
pGrenade->pev->velocity = g_vecZero;
|
||||||
pGrenade->pev->angles = vecAngles;
|
pGrenade->pev->angles = vecAngles;
|
||||||
|
|
||||||
|
if (pevOwner)
|
||||||
pGrenade->pev->owner = ENT(pevOwner);
|
pGrenade->pev->owner = ENT(pevOwner);
|
||||||
|
else
|
||||||
|
pGrenade->pev->owner = nullptr;
|
||||||
|
|
||||||
// Detonate in "time" seconds
|
// Detonate in "time" seconds
|
||||||
pGrenade->SetThink(&CGrenade::C4Think);
|
pGrenade->SetThink(&CGrenade::C4Think);
|
||||||
@ -1211,7 +1215,7 @@ CGrenade *CGrenade::__API_HOOK(ShootSatchelCharge)(entvars_t *pevOwner, VectorRe
|
|||||||
|
|
||||||
#ifdef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
TraceResult tr;
|
TraceResult tr;
|
||||||
UTIL_TraceLine(vecStart, vecStart + Vector(0, 0, -8192), ignore_monsters, ENT(pevOwner), &tr);
|
UTIL_TraceLine(vecStart, vecStart + Vector(0, 0, -8192), ignore_monsters, pGrenade->pev->owner, &tr);
|
||||||
pGrenade->pev->oldorigin = (tr.flFraction == 1.0) ? vecStart : tr.vecEndPos;
|
pGrenade->pev->oldorigin = (tr.flFraction == 1.0) ? vecStart : tr.vecEndPos;
|
||||||
|
|
||||||
pGrenade->pev->nextthink = gpGlobals->time + 0.01f;
|
pGrenade->pev->nextthink = gpGlobals->time + 0.01f;
|
||||||
@ -1235,16 +1239,16 @@ CGrenade *CGrenade::__API_HOOK(ShootSatchelCharge)(entvars_t *pevOwner, VectorRe
|
|||||||
pGrenade->pev->friction = 0.9f;
|
pGrenade->pev->friction = 0.9f;
|
||||||
pGrenade->m_bJustBlew = false;
|
pGrenade->m_bJustBlew = false;
|
||||||
|
|
||||||
|
edict_t *pEntCurBombTarget = nullptr;
|
||||||
|
if (pevOwner)
|
||||||
|
{
|
||||||
CBasePlayer *pOwner = CBasePlayer::Instance(pevOwner);
|
CBasePlayer *pOwner = CBasePlayer::Instance(pevOwner);
|
||||||
if (pOwner && pOwner->IsPlayer())
|
if (pOwner && pOwner->IsPlayer())
|
||||||
{
|
pEntCurBombTarget = pOwner->m_pentCurBombTarget;
|
||||||
pGrenade->m_pentCurBombTarget = pOwner->m_pentCurBombTarget;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pGrenade->m_pentCurBombTarget = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pGrenade->m_pentCurBombTarget = pEntCurBombTarget;
|
||||||
|
|
||||||
return pGrenade;
|
return pGrenade;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <API/CSInterfaces.h>
|
#include <API/CSInterfaces.h>
|
||||||
|
|
||||||
#define REGAMEDLL_API_VERSION_MAJOR 5
|
#define REGAMEDLL_API_VERSION_MAJOR 5
|
||||||
#define REGAMEDLL_API_VERSION_MINOR 19
|
#define REGAMEDLL_API_VERSION_MINOR 20
|
||||||
|
|
||||||
// CBasePlayer::Spawn hook
|
// CBasePlayer::Spawn hook
|
||||||
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
|
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
|
||||||
@ -641,6 +641,7 @@ struct ReGameFuncs_t {
|
|||||||
void (*RemoveEntityHashValue)(entvars_t *pev, const char *value, hash_types_e fieldType);
|
void (*RemoveEntityHashValue)(entvars_t *pev, const char *value, hash_types_e fieldType);
|
||||||
int (*Cmd_Argc)();
|
int (*Cmd_Argc)();
|
||||||
const char *(*Cmd_Argv)(int i);
|
const char *(*Cmd_Argv)(int i);
|
||||||
|
class CGrenade *(*PlantBomb)(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IReGameApi {
|
class IReGameApi {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user