mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-30 16:45:51 +03:00
183a9f674c
Rollback: remove virtual destructor in class CBaseEntity Add: Using info about item from table weaponInfo (yet only for hegrenade, flashbang, smokegrenade)
89 lines
1.7 KiB
C++
89 lines
1.7 KiB
C++
#include "precompiled.h"
|
|
|
|
CMapInfo *g_pMapInfo = nullptr;
|
|
|
|
CMapInfo::CMapInfo()
|
|
{
|
|
m_flBombRadius = 500.0f;
|
|
m_iBuyingStatus = BUYING_EVERYONE;
|
|
|
|
#ifdef REGAMEDLL_ADD
|
|
if (g_pMapInfo)
|
|
{
|
|
// Should only be one of these.
|
|
ALERT(at_warning, "Warning: Multiple info_map_parameters entities in map!\n");
|
|
}
|
|
else
|
|
#endif
|
|
{
|
|
g_pMapInfo = this;
|
|
}
|
|
}
|
|
|
|
void CMapInfo::CheckMapInfo()
|
|
{
|
|
bool bCTCantBuy, bTCantBuy;
|
|
switch (m_iBuyingStatus)
|
|
{
|
|
case BUYING_EVERYONE:
|
|
bCTCantBuy = false;
|
|
bTCantBuy = false;
|
|
|
|
ALERT(at_console, "EVERYONE CAN BUY!\n");
|
|
break;
|
|
case BUYING_ONLY_CTS:
|
|
bCTCantBuy = false;
|
|
bTCantBuy = true;
|
|
|
|
ALERT(at_console, "Only CT's can buy!!\n");
|
|
break;
|
|
case BUYING_ONLY_TERRORISTS:
|
|
bCTCantBuy = true;
|
|
bTCantBuy = false;
|
|
|
|
ALERT(at_console, "Only T's can buy!!\n");
|
|
break;
|
|
case BUYING_NO_ONE:
|
|
bCTCantBuy = true;
|
|
bTCantBuy = true;
|
|
|
|
ALERT(at_console, "No one can buy!!\n");
|
|
break;
|
|
default:
|
|
bCTCantBuy = false;
|
|
bTCantBuy = false;
|
|
break;
|
|
}
|
|
|
|
CSGameRules()->m_flBombRadius = m_flBombRadius;
|
|
CSGameRules()->m_bCTCantBuy = bCTCantBuy;
|
|
CSGameRules()->m_bTCantBuy = bTCantBuy;
|
|
}
|
|
|
|
void CMapInfo::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
|
{
|
|
if (FStrEq(pkvd->szKeyName, "buying"))
|
|
{
|
|
m_iBuyingStatus = (InfoMapBuyParam)Q_atoi(pkvd->szValue);
|
|
pkvd->fHandled = TRUE;
|
|
}
|
|
else if (FStrEq(pkvd->szKeyName, "bombradius"))
|
|
{
|
|
m_flBombRadius = (float)Q_atoi(pkvd->szValue);
|
|
|
|
if (m_flBombRadius > MAX_BOMB_RADIUS)
|
|
m_flBombRadius = MAX_BOMB_RADIUS;
|
|
|
|
pkvd->fHandled = TRUE;
|
|
}
|
|
}
|
|
|
|
void CMapInfo::__MAKE_VHOOK(Spawn)()
|
|
{
|
|
pev->movetype = MOVETYPE_NONE;
|
|
pev->solid = SOLID_NOT;
|
|
pev->effects |= EF_NODRAW;
|
|
}
|
|
|
|
LINK_ENTITY_TO_CLASS(info_map_parameters, CMapInfo, CCSMapInfo);
|