mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-29 23:18:03 +03:00
Ignore by default fireonce flag for trigger_auto (Related #55)
Fix: does not reset the clones of multi_manager. Added: Do not allow to do spawn, if player chooses a team or appearance (Related #61) Update FGD
This commit is contained in:
parent
66209cecda
commit
9bfa67b54d
@ -243,15 +243,27 @@ BOOL CMultiSource::__MAKE_VHOOK(IsTriggered)(CBaseEntity *)
|
|||||||
|
|
||||||
void CMultiSource::Register()
|
void CMultiSource::Register()
|
||||||
{
|
{
|
||||||
edict_t *pentTarget = NULL;
|
|
||||||
|
|
||||||
m_iTotal = 0;
|
m_iTotal = 0;
|
||||||
Q_memset(m_rgEntities, 0, MS_MAX_TARGETS * sizeof(EHANDLE));
|
Q_memset(m_rgEntities, 0, MS_MAX_TARGETS * sizeof(EHANDLE));
|
||||||
|
|
||||||
SetThink(&CMultiSource::SUB_DoNothing);
|
SetThink(&CMultiSource::SUB_DoNothing);
|
||||||
|
|
||||||
// search for all entities which target this multisource (pev->targetname)
|
// search for all entities which target this multisource (pev->targetname)
|
||||||
pentTarget = FIND_ENTITY_BY_STRING(NULL, "target", STRING(pev->targetname));
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
CBaseEntity *pTarget = nullptr;
|
||||||
|
while (m_iTotal < MS_MAX_TARGETS && (pTarget = UTIL_FindEntityByTargetname(pTarget, "multi_manager"))) {
|
||||||
|
m_rgEntities[m_iTotal++] = pTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
pTarget = nullptr;
|
||||||
|
while (m_iTotal < MS_MAX_TARGETS && (pTarget = UTIL_FindEntityByClassname(pTarget, "multi_manager")))
|
||||||
|
{
|
||||||
|
if (pTarget->HasTarget(pev->targetname)) {
|
||||||
|
m_rgEntities[m_iTotal++] = pTarget;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
edict_t *pentTarget = FIND_ENTITY_BY_STRING(NULL, "target", STRING(pev->targetname));
|
||||||
|
|
||||||
while (!FNullEnt(pentTarget) && m_iTotal < MS_MAX_TARGETS)
|
while (!FNullEnt(pentTarget) && m_iTotal < MS_MAX_TARGETS)
|
||||||
{
|
{
|
||||||
@ -277,7 +289,7 @@ void CMultiSource::Register()
|
|||||||
|
|
||||||
pentTarget = FIND_ENTITY_BY_STRING(pentTarget, "classname", "multi_manager");
|
pentTarget = FIND_ENTITY_BY_STRING(pentTarget, "classname", "multi_manager");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
pev->spawnflags &= ~SF_MULTI_INIT;
|
pev->spawnflags &= ~SF_MULTI_INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5150,6 +5150,13 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(Spawn)()
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Do not allow to do spawn, if player chooses a team or appearance.
|
||||||
|
if (m_bJustConnected && m_iJoiningState == PICKINGTEAM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_iGaitsequence = 0;
|
m_iGaitsequence = 0;
|
||||||
|
|
||||||
m_flGaitframe = 0;
|
m_flGaitframe = 0;
|
||||||
|
@ -150,7 +150,11 @@ void CAutoTrigger::__MAKE_VHOOK(Think)()
|
|||||||
{
|
{
|
||||||
SUB_UseTargets(this, triggerType, 0);
|
SUB_UseTargets(this, triggerType, 0);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (pev->spawnflags & SF_AUTO_NO_RESET)
|
||||||
|
#else
|
||||||
if (pev->spawnflags & SF_AUTO_FIREONCE)
|
if (pev->spawnflags & SF_AUTO_FIREONCE)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
UTIL_Remove(this);
|
UTIL_Remove(this);
|
||||||
}
|
}
|
||||||
@ -360,6 +364,12 @@ CMultiManager *CMultiManager::Clone()
|
|||||||
Q_memcpy(pMulti->m_iTargetName, m_iTargetName, sizeof(m_iTargetName));
|
Q_memcpy(pMulti->m_iTargetName, m_iTargetName, sizeof(m_iTargetName));
|
||||||
Q_memcpy(pMulti->m_flTargetDelay, m_flTargetDelay, sizeof(m_flTargetDelay));
|
Q_memcpy(pMulti->m_flTargetDelay, m_flTargetDelay, sizeof(m_flTargetDelay));
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Add entity in hash table, otherwise,
|
||||||
|
// it will not be reset for the entity via UTIL_RestartRound
|
||||||
|
MAKE_STRING_CLASS("multi_manager", pMulti->pev);
|
||||||
|
#endif
|
||||||
|
|
||||||
return pMulti;
|
return pMulti;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2066,7 +2066,6 @@
|
|||||||
[
|
[
|
||||||
spawnflags(Flags) =
|
spawnflags(Flags) =
|
||||||
[
|
[
|
||||||
1 : "Remove On fire" : 1
|
|
||||||
2 : "No reset on New Round" : 0
|
2 : "No reset on New Round" : 0
|
||||||
]
|
]
|
||||||
globalstate(string) : "Global State to Read"
|
globalstate(string) : "Global State to Read"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user