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:
s1lentq 2016-09-26 01:05:55 +07:00
parent 66209cecda
commit 9bfa67b54d
4 changed files with 33 additions and 5 deletions

View File

@ -243,15 +243,27 @@ BOOL CMultiSource::__MAKE_VHOOK(IsTriggered)(CBaseEntity *)
void CMultiSource::Register()
{
edict_t *pentTarget = NULL;
m_iTotal = 0;
Q_memset(m_rgEntities, 0, MS_MAX_TARGETS * sizeof(EHANDLE));
SetThink(&CMultiSource::SUB_DoNothing);
// 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)
{
@ -277,7 +289,7 @@ void CMultiSource::Register()
pentTarget = FIND_ENTITY_BY_STRING(pentTarget, "classname", "multi_manager");
}
#endif
pev->spawnflags &= ~SF_MULTI_INIT;
}

View File

@ -5150,6 +5150,13 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(Spawn)()
{
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_flGaitframe = 0;

View File

@ -150,7 +150,11 @@ void CAutoTrigger::__MAKE_VHOOK(Think)()
{
SUB_UseTargets(this, triggerType, 0);
#ifdef REGAMEDLL_FIXES
if (pev->spawnflags & SF_AUTO_NO_RESET)
#else
if (pev->spawnflags & SF_AUTO_FIREONCE)
#endif
{
UTIL_Remove(this);
}
@ -360,6 +364,12 @@ CMultiManager *CMultiManager::Clone()
Q_memcpy(pMulti->m_iTargetName, m_iTargetName, sizeof(m_iTargetName));
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;
}

View File

@ -2066,7 +2066,6 @@
[
spawnflags(Flags) =
[
1 : "Remove On fire" : 1
2 : "No reset on New Round" : 0
]
globalstate(string) : "Global State to Read"