mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-27 05:58:00 +03:00
'game_player_equip' checking buggy maps
This commit is contained in:
parent
1ac96b8180
commit
63efbfc1d6
@ -563,6 +563,33 @@ void CGamePlayerEquip::KeyValue(KeyValueData *pkvd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CGamePlayerEquip::HasBuggyMap() const
|
||||||
|
{
|
||||||
|
if (!UseOnly())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
CBaseEntity *pEntity = NULL;
|
||||||
|
while ((pEntity = UTIL_FindEntityByClassname(pEntity, "multi_manager")))
|
||||||
|
{
|
||||||
|
if (FNullEnt(pEntity))
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Consider case with game_playerspawn only
|
||||||
|
if (!FStrEq(pEntity->pev->targetname, "game_playerspawn"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Lookup 'game_player_equip' into multi_manager
|
||||||
|
if (pEntity->HasTarget(pev->targetname))
|
||||||
|
{
|
||||||
|
ALERT(at_warning, "%s is BUGGY! 'game_player_equip' may be called twice, this has only direct actiavte behavior.\nTriggered by (#%d) %s.\n",
|
||||||
|
STRING(gpGlobals->mapname), ENTINDEX(pEntity->pev), STRING(pEntity->pev->classname));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void CGamePlayerEquip::Touch(CBaseEntity *pOther)
|
void CGamePlayerEquip::Touch(CBaseEntity *pOther)
|
||||||
{
|
{
|
||||||
if (CanEquipOverTouch(pOther))
|
if (CanEquipOverTouch(pOther))
|
||||||
|
@ -258,7 +258,8 @@ public:
|
|||||||
public:
|
public:
|
||||||
bool UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; }
|
bool UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; }
|
||||||
bool RemoveWeapons() const { return (pev->spawnflags & SF_PLAYEREQUIP_REMOVEWEAPONS) == SF_PLAYEREQUIP_REMOVEWEAPONS; }
|
bool RemoveWeapons() const { return (pev->spawnflags & SF_PLAYEREQUIP_REMOVEWEAPONS) == SF_PLAYEREQUIP_REMOVEWEAPONS; }
|
||||||
|
bool HasBuggyMap() const;
|
||||||
|
|
||||||
bool CanEquipOverTouch(CBaseEntity *pOther)
|
bool CanEquipOverTouch(CBaseEntity *pOther)
|
||||||
{
|
{
|
||||||
if (!CanFireForActivator(pOther))
|
if (!CanFireForActivator(pOther))
|
||||||
|
@ -9978,9 +9978,15 @@ void EXT_FUNC CBasePlayer::__API_HOOK(OnSpawnEquip)(bool addDefault, bool equipG
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
pWeaponEntity->Touch(this);
|
pWeaponEntity->Touch(this);
|
||||||
|
|
||||||
addDefault = false;
|
addDefault = false;
|
||||||
}
|
}
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// TODO: Remove me someday!
|
||||||
|
// Check buggy map and spew message about it!
|
||||||
|
// 'game_player_equip' may be call twice on player spawn and 'game_playerspawn' event
|
||||||
|
else if (pWeaponEntity->HasBuggyMap())
|
||||||
|
addDefault = false; // Don't give default items now, because we have a deferred equipment
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1727,7 +1727,7 @@ bool UTIL_AreHostagesImprov()
|
|||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
if (g_engfuncs.pfnEngCheckParm == nullptr)
|
if (g_engfuncs.pfnEngCheckParm == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// someday in CS 1.6
|
// someday in CS 1.6
|
||||||
int improv = ENG_CHECK_PARM("-host-improv", nullptr);
|
int improv = ENG_CHECK_PARM("-host-improv", nullptr);
|
||||||
if (improv)
|
if (improv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user