func_bomb_target: new feature "strict touch" (#636)

This commit is contained in:
Vaqtincha 2021-06-06 23:17:18 +05:00 committed by GitHub
parent ab846f86f4
commit 49b2412e9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View File

@ -1825,6 +1825,21 @@ void CBuyZone::BuyTouch(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(func_bomb_target, CBombTarget, CCSBombTarget)
void CBombTarget::KeyValue(KeyValueData *pkvd)
{
#ifdef REGAMEDLL_ADD
if (FStrEq(pkvd->szKeyName, "strict_touch") && Q_atoi(pkvd->szValue) > 0)
{
m_bStrictTouch = true;
pkvd->fHandled = TRUE;
}
else
#endif
{
CBaseTrigger::KeyValue(pkvd);
}
}
void CBombTarget::Spawn()
{
InitTrigger();
@ -1861,7 +1876,7 @@ void CBombTarget::BombTargetTouch(CBaseEntity *pOther)
if (pPlayer->m_bHasC4)
{
#ifdef REGAMEDLL_ADD
if (!legacy_bombtarget_touch.value)
if (!legacy_bombtarget_touch.value || m_bStrictTouch)
#endif
{

View File

@ -409,8 +409,15 @@ private:
bool IsPlayerInBombSite(CBasePlayer *pPlayer);
public:
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
void EXPORT BombTargetTouch(CBaseEntity *pOther);
void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef REGAMEDLL_ADD
public:
bool m_bStrictTouch;
#endif
};
class CHostageRescue: public CBaseTrigger

View File

@ -2268,6 +2268,11 @@
@SolidClass = func_bomb_target : "Bomb target zone"
[
target(target_destination) : "Target (when bomb blows)"
strict_touch(choices) : "Touch mode" : 0 =
[
0: "Legacy"
1: "New one (is more strict)"
]
]
@SolidClass base(Targetname) = trigger_cdaudio : "Trigger CD Audio"