mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
Use custom assert instead normal
This commit is contained in:
parent
db5cbee2b8
commit
abe648b9d6
@ -1294,7 +1294,7 @@ CCSBot::PathResult CCSBot::UpdatePathMovement(bool allowSpeedChange)
|
||||
if (IsOnLadder())
|
||||
Jump(MUST_JUMP);
|
||||
|
||||
assert(m_pathIndex < m_pathLength);
|
||||
Assert(m_pathIndex < m_pathLength);
|
||||
|
||||
// Check if reached the end of the path
|
||||
bool nearEndOfPath = false;
|
||||
|
@ -353,7 +353,7 @@ void IdleState::OnUpdate(CCSBot *me)
|
||||
}
|
||||
}
|
||||
|
||||
assert((0, "A CT bot doesn't know what to do while the bomb is planted!\n"));
|
||||
DbgAssert(!"A CT bot doesn't know what to do while the bomb is planted!\n");
|
||||
}
|
||||
|
||||
// if we have a sniper rifle, we like to camp, whether rogue or not
|
||||
|
@ -671,7 +671,7 @@ void CBaseButton::ButtonActivate()
|
||||
PlayLockSounds(pev, &m_ls, FALSE, TRUE);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_AT_BOTTOM);
|
||||
DbgAssert(m_toggle_state == TS_AT_BOTTOM);
|
||||
m_toggle_state = TS_GOING_UP;
|
||||
|
||||
SetMoveDone(&CBaseButton::TriggerAndWait);
|
||||
@ -688,7 +688,7 @@ void CBaseButton::ButtonActivate()
|
||||
// Button has reached the "in/up" position. Activate its "targets", and pause before "popping out".
|
||||
void CBaseButton::TriggerAndWait()
|
||||
{
|
||||
assert(m_toggle_state == TS_GOING_UP);
|
||||
DbgAssert(m_toggle_state == TS_GOING_UP);
|
||||
|
||||
if (!UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
|
||||
return;
|
||||
@ -724,7 +724,7 @@ void CBaseButton::TriggerAndWait()
|
||||
// Starts the button moving "out/down".
|
||||
void CBaseButton::ButtonReturn()
|
||||
{
|
||||
//assert(m_toggle_state == TS_AT_TOP);
|
||||
DbgAssert(m_toggle_state == TS_AT_TOP);
|
||||
m_toggle_state = TS_GOING_DOWN;
|
||||
|
||||
SetMoveDone(&CBaseButton::ButtonBackHome);
|
||||
@ -763,7 +763,7 @@ void CBaseButton::Restart()
|
||||
// Button has returned to start state. Quiesce it.
|
||||
void CBaseButton::ButtonBackHome()
|
||||
{
|
||||
assert(m_toggle_state == TS_GOING_DOWN);
|
||||
DbgAssert(m_toggle_state == TS_GOING_DOWN);
|
||||
m_toggle_state = TS_AT_BOTTOM;
|
||||
|
||||
if (pev->spawnflags & SF_BUTTON_TOGGLE
|
||||
@ -884,7 +884,7 @@ void CRotButton::Spawn()
|
||||
m_vecAngle1 = pev->angles;
|
||||
m_vecAngle2 = pev->angles + pev->movedir * m_flMoveDistance;
|
||||
|
||||
assert(("rotating button start/end positions are equal", m_vecAngle1 != m_vecAngle2));
|
||||
DbgAssertMsg(m_vecAngle1 != m_vecAngle2, "rotating button start/end positions are equal");
|
||||
|
||||
m_fStayPushed = (m_flWait == -1 ? TRUE : FALSE);
|
||||
m_fRotating = TRUE;
|
||||
|
@ -215,7 +215,7 @@ void CBaseDoor::Spawn()
|
||||
// Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big
|
||||
m_vecPosition2 = m_vecPosition1 + (pev->movedir * (Q_fabs(real_t(pev->movedir.x * (pev->size.x - 2))) + Q_fabs(real_t(pev->movedir.y * (pev->size.y - 2))) + Q_fabs(real_t(pev->movedir.z * (pev->size.z - 2))) - m_flLip));
|
||||
|
||||
assert(("door start/end positions are equal", m_vecPosition1 != m_vecPosition2));
|
||||
DbgAssertMsg(m_vecPosition1 != m_vecPosition2, "door start/end positions are equal");
|
||||
|
||||
if (pev->spawnflags & SF_DOOR_START_OPEN)
|
||||
{
|
||||
@ -494,7 +494,7 @@ void CBaseDoor::DoorGoUp()
|
||||
bool isReversing = (m_toggle_state == TS_GOING_DOWN);
|
||||
|
||||
// It could be going-down, if blocked.
|
||||
assert(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN);
|
||||
DbgAssert(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN);
|
||||
|
||||
// emit door moving and stop sounds on CHAN_STATIC so that the multicast doesn't
|
||||
// filter them out and leave a client stuck with looping door sounds!
|
||||
@ -634,7 +634,7 @@ void CBaseDoor::DoorHitTop()
|
||||
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseArrived), VOL_NORM, ATTN_NORM);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_GOING_UP);
|
||||
DbgAssert(m_toggle_state == TS_GOING_UP);
|
||||
m_toggle_state = TS_AT_TOP;
|
||||
|
||||
// toggle-doors don't come down automatically, they wait for refire.
|
||||
@ -696,7 +696,7 @@ void CBaseDoor::DoorGoDown()
|
||||
}
|
||||
|
||||
#ifdef DOOR_ASSERT
|
||||
assert(m_toggle_state == TS_AT_TOP);
|
||||
DbgAssert(m_toggle_state == TS_AT_TOP);
|
||||
#endif
|
||||
|
||||
m_toggle_state = TS_GOING_DOWN;
|
||||
@ -724,7 +724,7 @@ void CBaseDoor::DoorHitBottom()
|
||||
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseArrived), VOL_NORM, ATTN_NORM);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_GOING_DOWN);
|
||||
DbgAssert(m_toggle_state == TS_GOING_DOWN);
|
||||
m_toggle_state = TS_AT_BOTTOM;
|
||||
|
||||
// Re-instate touch method, cycle is complete
|
||||
@ -927,7 +927,7 @@ void CRotDoor::Spawn()
|
||||
m_vecAngle1 = pev->angles;
|
||||
m_vecAngle2 = pev->angles + pev->movedir * m_flMoveDistance;
|
||||
|
||||
assert(("rotating door start/end positions are equal", m_vecAngle1 != m_vecAngle2));
|
||||
DbgAssertMsg(m_vecAngle1 != m_vecAngle2, "rotating door start/end positions are equal");
|
||||
|
||||
if (pev->spawnflags & SF_DOOR_PASSABLE)
|
||||
pev->solid = SOLID_NOT;
|
||||
@ -1011,7 +1011,7 @@ void CMomentaryDoor::Spawn()
|
||||
|
||||
// Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big
|
||||
m_vecPosition2 = m_vecPosition1 + (pev->movedir * (Q_fabs(real_t(pev->movedir.x * (pev->size.x - 2))) + Q_fabs(real_t(pev->movedir.y * (pev->size.y - 2))) + Q_fabs(real_t(pev->movedir.z * (pev->size.z - 2))) - m_flLip));
|
||||
assert(("door start/end positions are equal", m_vecPosition1 != m_vecPosition2));
|
||||
DbgAssertMsg(m_vecPosition1 != m_vecPosition2, "door start/end positions are equal");
|
||||
|
||||
if (pev->spawnflags & SF_DOOR_START_OPEN)
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ inline int EntityHandle<T>::GetSerialNumber() const
|
||||
template <typename T>
|
||||
inline bool EntityHandle<T>::operator==(T *pEntity) const
|
||||
{
|
||||
assert(("EntityHandle<T>::operator==: got a nullptr pointer!", pEntity != nullptr));
|
||||
DbgAssertMsg(pEntity != nullptr, "EntityHandle<T>::operator==: got a nullptr pointer!");
|
||||
|
||||
if (m_serialnumber != pEntity->edict()->serialnumber)
|
||||
{
|
||||
@ -221,10 +221,10 @@ template <typename T>
|
||||
inline T *EntityHandle<T>::operator->()
|
||||
{
|
||||
edict_t *pEdict = Get();
|
||||
assert(("EntityHandle<T>::operator->: pointer is nullptr!", pEdict != nullptr));
|
||||
DbgAssertMsg(pEdict != nullptr, "EntityHandle<T>::operator->: pointer is nullptr!");
|
||||
|
||||
T *pEntity = GET_PRIVATE<T>(pEdict);
|
||||
assert(("EntityHandle<T>::operator->: pvPrivateData is nullptr!", pEntity != nullptr));
|
||||
DbgAssertMsg(pEntity != nullptr, "EntityHandle<T>::operator->: pvPrivateData is nullptr!");
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
|
@ -297,11 +297,11 @@ void CFuncTank::StopControl()
|
||||
|
||||
void CFuncTank::ControllerPostFrame()
|
||||
{
|
||||
assert(m_pController != nullptr);
|
||||
|
||||
if (gpGlobals->time < m_flNextAttack)
|
||||
return;
|
||||
|
||||
Assert(m_pController != nullptr);
|
||||
|
||||
if (m_pController->pev->button & IN_ATTACK)
|
||||
{
|
||||
Vector vecForward;
|
||||
@ -879,7 +879,7 @@ void CFuncTankControls::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
|
||||
}
|
||||
|
||||
// if this fails, most likely means save/restore hasn't worked properly
|
||||
assert(m_pTank != nullptr);
|
||||
DbgAssert(m_pTank != nullptr);
|
||||
}
|
||||
|
||||
void CFuncTankControls::Think()
|
||||
|
@ -4878,7 +4878,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ChangeLevel)()
|
||||
|
||||
// find the map to change to
|
||||
char *mapcfile = (char *)CVAR_GET_STRING("mapcyclefile");
|
||||
assert(mapcfile != nullptr);
|
||||
Assert(mapcfile != nullptr);
|
||||
|
||||
szCommands[0] = '\0';
|
||||
szRules[0] = '\0';
|
||||
@ -4914,7 +4914,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ChangeLevel)()
|
||||
{
|
||||
keeplooking = false;
|
||||
|
||||
assert(item != nullptr);
|
||||
Assert(item != nullptr);
|
||||
|
||||
if (item->minplayers != 0)
|
||||
{
|
||||
@ -5276,7 +5276,7 @@ int CHalfLifeMultiplay::GetRarityOfKill(CBaseEntity *pKiller, CBasePlayer *pVict
|
||||
// That is done so that the domination and revenge will be calculated prior
|
||||
// to the death message being sent to the clients
|
||||
int iAttackerEntityIndex = pKillerPlayer->entindex();
|
||||
assert(iAttackerEntityIndex > 0 && iAttackerEntityIndex <= MAX_CLIENTS);
|
||||
Assert(iAttackerEntityIndex > 0 && iAttackerEntityIndex <= MAX_CLIENTS);
|
||||
|
||||
int iKillsUnanswered = pVictim->CSPlayer()->m_iNumKilledByUnanswered[iAttackerEntityIndex - 1] + 1;
|
||||
if (iKillsUnanswered == CS_KILLS_FOR_DOMINATION || pKillerPlayer->CSPlayer()->IsPlayerDominated(pVictim->entindex() - 1))
|
||||
|
@ -23,7 +23,7 @@ void CPathCorner::KeyValue(KeyValueData *pkvd)
|
||||
|
||||
void CPathCorner::Spawn()
|
||||
{
|
||||
assert(("path_corner without a targetname", !pev->targetname.IsNull()));
|
||||
DbgAssertMsg(!pev->targetname.IsNull(), "path_corner without a targetname");
|
||||
}
|
||||
|
||||
TYPEDESCRIPTION CPathTrack::m_SaveData[] =
|
||||
|
@ -382,7 +382,7 @@ void CFuncPlat::GoDown()
|
||||
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseMovement), m_volume, ATTN_NORM);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP);
|
||||
DbgAssert(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP);
|
||||
m_toggle_state = TS_GOING_DOWN;
|
||||
SetMoveDone(&CFuncPlat::CallHitBottom);
|
||||
LinearMove(m_vecPosition2, pev->speed);
|
||||
@ -401,7 +401,7 @@ void CFuncPlat::HitBottom()
|
||||
EMIT_SOUND(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStopMoving), m_volume, ATTN_NORM);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_GOING_DOWN);
|
||||
DbgAssert(m_toggle_state == TS_GOING_DOWN);
|
||||
m_toggle_state = TS_AT_BOTTOM;
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ void CFuncPlat::GoUp()
|
||||
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseMovement), m_volume, ATTN_NORM);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN);
|
||||
DbgAssert(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN);
|
||||
m_toggle_state = TS_GOING_UP;
|
||||
SetMoveDone(&CFuncPlat::CallHitTop);
|
||||
LinearMove(m_vecPosition1, pev->speed);
|
||||
@ -432,7 +432,7 @@ void CFuncPlat::HitTop()
|
||||
EMIT_SOUND(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStopMoving), m_volume, ATTN_NORM);
|
||||
}
|
||||
|
||||
assert(m_toggle_state == TS_GOING_UP);
|
||||
DbgAssert(m_toggle_state == TS_GOING_UP);
|
||||
m_toggle_state = TS_AT_TOP;
|
||||
|
||||
if (!IsTogglePlat())
|
||||
@ -456,7 +456,7 @@ void CFuncPlat::Blocked(CBaseEntity *pOther)
|
||||
}
|
||||
|
||||
// Send the platform back where it came from
|
||||
assert(m_toggle_state == TS_GOING_UP || m_toggle_state == TS_GOING_DOWN);
|
||||
DbgAssert(m_toggle_state == TS_GOING_UP || m_toggle_state == TS_GOING_DOWN);
|
||||
|
||||
if (m_toggle_state == TS_GOING_UP)
|
||||
{
|
||||
|
@ -6504,8 +6504,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(ImpulseCommands)()
|
||||
else
|
||||
iOn = 0;
|
||||
|
||||
assert(gmsgLogo > 0);
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgLogo, nullptr, pev);
|
||||
WRITE_BYTE(iOn);
|
||||
MESSAGE_END();
|
||||
@ -7143,9 +7141,6 @@ void CBasePlayer::SendAmmoUpdate()
|
||||
{
|
||||
m_rgAmmoLast[i] = m_rgAmmo[i];
|
||||
|
||||
assert(m_rgAmmo[i] >= 0);
|
||||
assert(m_rgAmmo[i] <= 255);
|
||||
|
||||
// send "Ammo" update message
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgAmmoX, nullptr, pev);
|
||||
WRITE_BYTE(i);
|
||||
@ -7427,8 +7422,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(UpdateClientData)()
|
||||
{
|
||||
m_iClientBattery = int(pev->armorvalue);
|
||||
|
||||
assert(gmsgBattery > 0);
|
||||
|
||||
// send "armor" update message
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgBattery, nullptr, pev);
|
||||
WRITE_SHORT(int(pev->armorvalue));
|
||||
@ -7510,8 +7503,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(UpdateClientData)()
|
||||
|
||||
if (m_iTrain & TRAIN_NEW)
|
||||
{
|
||||
assert(gmsgTrain > 0);
|
||||
|
||||
// send "train hud" update message
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgTrain, nullptr, pev);
|
||||
WRITE_BYTE(m_iTrain & 0xF);
|
||||
|
@ -955,10 +955,10 @@ void CGlobalState::DumpGlobals()
|
||||
|
||||
void CGlobalState::EntityAdd(string_t globalname, string_t mapName, GLOBALESTATE state)
|
||||
{
|
||||
assert(!Find(globalname));
|
||||
DbgAssert(!Find(globalname));
|
||||
|
||||
globalentity_t *pNewEntity = (globalentity_t *)calloc(sizeof(globalentity_t), 1);
|
||||
assert(pNewEntity != nullptr);
|
||||
DbgAssert(pNewEntity != nullptr);
|
||||
|
||||
pNewEntity->pNext = m_pList;
|
||||
m_pList = pNewEntity;
|
||||
|
@ -330,8 +330,8 @@ void CBaseToggle::KeyValue(KeyValueData *pkvd)
|
||||
// pev->origin traveling at flSpeed
|
||||
void CBaseToggle::LinearMove(Vector vecDest, float flSpeed)
|
||||
{
|
||||
assert(("LinearMove: no speed is defined!", flSpeed != 0));
|
||||
//assert(("LinearMove: no post-move function defined", m_pfnCallWhenMoveDone != nullptr));
|
||||
DbgAssertMsg(flSpeed != 0, "LinearMove: no speed is defined!");
|
||||
//DbgAssertMsg(m_pfnCallWhenMoveDone != nullptr, "LinearMove: no post-move function defined");
|
||||
|
||||
m_vecFinalDest = vecDest;
|
||||
|
||||
@ -382,8 +382,8 @@ NOXREF BOOL CBaseToggle::IsLockedByMaster()
|
||||
// Just like LinearMove, but rotational.
|
||||
void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed)
|
||||
{
|
||||
assert(("AngularMove: no speed is defined!", flSpeed != 0));
|
||||
//assert(("AngularMove: no post-move function defined", m_pfnCallWhenMoveDone != nullptr));
|
||||
DbgAssertMsg(flSpeed != 0, "AngularMove: no speed is defined!");
|
||||
//DbgAssertMsg(m_pfnCallWhenMoveDone != nullptr, "AngularMove: no post-move function defined");
|
||||
|
||||
m_vecFinalAngle = vecDestAngle;
|
||||
|
||||
|
@ -971,7 +971,7 @@ void CTriggerMultiple::Spawn()
|
||||
|
||||
InitTrigger();
|
||||
|
||||
assert(("trigger_multiple with health", pev->health == 0));
|
||||
DbgAssertMsg(pev->health == 0, "trigger_multiple with health");
|
||||
|
||||
//UTIL_SetOrigin(pev, pev->origin);
|
||||
//SET_MODEL(ENT(pev), STRING(pev->model));
|
||||
|
@ -236,7 +236,7 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname)
|
||||
}
|
||||
|
||||
giAmmoIndex++;
|
||||
assert(giAmmoIndex < MAX_AMMO_SLOTS);
|
||||
DbgAssert(giAmmoIndex < MAX_AMMO_SLOTS);
|
||||
|
||||
if (giAmmoIndex >= MAX_AMMO_SLOTS)
|
||||
giAmmoIndex = 1;
|
||||
|
@ -127,7 +127,7 @@ inline CBitVec<NUM_BITS> &CBitVec<NUM_BITS>::operator=(CBitVec<NUM_BITS> const &
|
||||
template<int NUM_BITS>
|
||||
inline CBitVecAccessor CBitVec<NUM_BITS>::operator[](int i)
|
||||
{
|
||||
assert(i >= 0 && i < GetNumBits());
|
||||
DbgAssert(i >= 0 && i < GetNumBits());
|
||||
return CBitVecAccessor(m_DWords, i);
|
||||
}
|
||||
|
||||
@ -152,13 +152,13 @@ inline bool CBitVec<NUM_BITS>::operator!=(CBitVec<NUM_BITS> const &other)
|
||||
template<int NUM_BITS>
|
||||
inline uint32 CBitVec<NUM_BITS>::GetDWord(int i)
|
||||
{
|
||||
assert(i >= 0 && i < NUM_DWORDS);
|
||||
DbgAssert(i >= 0 && i < NUM_DWORDS);
|
||||
return m_DWords[i];
|
||||
}
|
||||
|
||||
template<int NUM_BITS>
|
||||
inline void CBitVec<NUM_BITS>::SetDWord(int i, uint32 val)
|
||||
{
|
||||
assert(i >= 0 && i < NUM_DWORDS);
|
||||
DbgAssert(i >= 0 && i < NUM_DWORDS);
|
||||
m_DWords[i] = val;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
@ -42,7 +41,7 @@ PlaceDirectory::EntryType PlaceDirectory::GetEntry(Place place) const
|
||||
auto it = std::find(m_directory.begin(), m_directory.end(), place);
|
||||
if (it == m_directory.end())
|
||||
{
|
||||
assert(false && "PlaceDirectory::GetEntry failure");
|
||||
DbgAssert(false && "PlaceDirectory::GetEntry failure");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -54,7 +53,7 @@ void PlaceDirectory::AddPlace(Place place)
|
||||
if (place == UNDEFINED_PLACE)
|
||||
return;
|
||||
|
||||
assert(place < 1000);
|
||||
DbgAssert(place < 1000);
|
||||
|
||||
if (IsKnown(place))
|
||||
return;
|
||||
@ -70,7 +69,7 @@ Place PlaceDirectory::EntryToPlace(EntryType entry) const
|
||||
unsigned int i = entry - 1;
|
||||
if (i > m_directory.size())
|
||||
{
|
||||
assert(false && "PlaceDirectory::EntryToPlace: Invalid entry");
|
||||
DbgAssert(false && "PlaceDirectory::EntryToPlace: Invalid entry");
|
||||
return UNDEFINED_PLACE;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ char EXT_FUNC PM_FindTextureType(char *name)
|
||||
int left, right, pivot;
|
||||
int val;
|
||||
|
||||
assert(pm_shared_initialized);
|
||||
DbgAssert(pm_shared_initialized);
|
||||
|
||||
left = 0;
|
||||
right = pm_gcTextures - 1;
|
||||
@ -3272,7 +3272,7 @@ LINK_HOOK_VOID_CHAIN(PM_Move, (struct playermove_s *ppmove, int server), ppmove,
|
||||
// and client. This will ensure that prediction behaves appropriately.
|
||||
void EXT_FUNC __API_HOOK(PM_Move)(struct playermove_s *ppmove, int server)
|
||||
{
|
||||
assert(pm_shared_initialized);
|
||||
DbgAssert(pm_shared_initialized);
|
||||
|
||||
pmove = ppmove;
|
||||
|
||||
@ -3317,7 +3317,7 @@ LINK_HOOK_VOID_CHAIN(PM_Init, (struct playermove_s *ppmove), ppmove)
|
||||
|
||||
void EXT_FUNC __API_HOOK(PM_Init)(struct playermove_s *ppmove)
|
||||
{
|
||||
assert(!pm_shared_initialized);
|
||||
DbgAssert(!pm_shared_initialized);
|
||||
|
||||
pmove = ppmove;
|
||||
|
||||
|
@ -230,7 +230,7 @@ void *InitializeInterface(char const *interfaceName, CreateInterfaceFn *factoryL
|
||||
}
|
||||
|
||||
// No provider for requested interface!!!
|
||||
// assert(!"No provider for requested interface!!!");
|
||||
// Assert(!"No provider for requested interface!!!");
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -207,6 +207,6 @@ inline bool CCSPlayer::IsPlayerDominated(int iPlayerIndex) const
|
||||
inline void CCSPlayer::SetPlayerDominated(CBasePlayer *pPlayer, bool bDominated)
|
||||
{
|
||||
int iPlayerIndex = pPlayer->entindex();
|
||||
assert(iPlayerIndex > 0 && iPlayerIndex <= MAX_CLIENTS);
|
||||
Assert(iPlayerIndex > 0 && iPlayerIndex <= MAX_CLIENTS);
|
||||
m_bPlayerDominated[iPlayerIndex - 1] = bDominated;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ const char *CUtlSymbolTable::String(CUtlSymbol id) const
|
||||
if (!id.IsValid())
|
||||
return "";
|
||||
|
||||
assert(m_Lookup.IsValidIndex((UtlSymId_t)id));
|
||||
DbgAssert(m_Lookup.IsValidIndex((UtlSymId_t)id));
|
||||
return &m_Strings[id];
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
|
||||
protected:
|
||||
// Can't copy this unless we explicitly do it!
|
||||
CUtlVector(CUtlVector const &vec) { assert(0); }
|
||||
CUtlVector(CUtlVector const &vec) { Assert(0); }
|
||||
|
||||
// Grows the vector
|
||||
void GrowVector(int num = 1);
|
||||
@ -203,28 +203,28 @@ inline CUtlVector<T> &CUtlVector<T>::operator=(const CUtlVector<T> &other)
|
||||
template <class T>
|
||||
inline T &CUtlVector<T>::operator[](int i)
|
||||
{
|
||||
assert(IsValidIndex(i));
|
||||
DbgAssert(IsValidIndex(i));
|
||||
return m_Memory[i];
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T const &CUtlVector<T>::operator[](int i) const
|
||||
{
|
||||
assert(IsValidIndex(i));
|
||||
DbgAssert(IsValidIndex(i));
|
||||
return m_Memory[i];
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T &CUtlVector<T>::Element(int i)
|
||||
{
|
||||
assert(IsValidIndex(i));
|
||||
DbgAssert(IsValidIndex(i));
|
||||
return m_Memory[i];
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T const &CUtlVector<T>::Element(int i) const
|
||||
{
|
||||
assert(IsValidIndex(i));
|
||||
DbgAssert(IsValidIndex(i));
|
||||
return m_Memory[i];
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ void CUtlVector<T>::EnsureCount(int num)
|
||||
template <class T>
|
||||
void CUtlVector<T>::ShiftElementsRight(int elem, int num)
|
||||
{
|
||||
assert(IsValidIndex(elem) || (m_Size == 0) || (num == 0));
|
||||
DbgAssert(IsValidIndex(elem) || (m_Size == 0) || (num == 0));
|
||||
int numToMove = m_Size - elem - num;
|
||||
if ((numToMove > 0) && (num > 0))
|
||||
memmove(&Element(elem+num), &Element(elem), numToMove * sizeof(T));
|
||||
@ -310,7 +310,7 @@ void CUtlVector<T>::ShiftElementsRight(int elem, int num)
|
||||
template <class T>
|
||||
void CUtlVector<T>::ShiftElementsLeft(int elem, int num)
|
||||
{
|
||||
assert(IsValidIndex(elem) || (m_Size == 0) || (num == 0));
|
||||
DbgAssert(IsValidIndex(elem) || (m_Size == 0) || (num == 0));
|
||||
int numToMove = m_Size - elem - num;
|
||||
if ((numToMove > 0) && (num > 0))
|
||||
{
|
||||
@ -345,7 +345,7 @@ template <class T>
|
||||
int CUtlVector<T>::InsertBefore(int elem)
|
||||
{
|
||||
// Can insert at the end
|
||||
assert((elem == Count()) || IsValidIndex(elem));
|
||||
DbgAssert((elem == Count()) || IsValidIndex(elem));
|
||||
|
||||
GrowVector();
|
||||
ShiftElementsRight(elem);
|
||||
@ -376,7 +376,7 @@ template< class T >
|
||||
int CUtlVector<T>::InsertBefore(int elem, T const &src)
|
||||
{
|
||||
// Can insert at the end
|
||||
assert((elem == Count()) || IsValidIndex(elem));
|
||||
DbgAssert((elem == Count()) || IsValidIndex(elem));
|
||||
|
||||
GrowVector();
|
||||
ShiftElementsRight(elem);
|
||||
@ -450,7 +450,7 @@ inline int CUtlVector<T>::InsertMultipleBefore(int elem, int num, const T *pToIn
|
||||
return elem;
|
||||
|
||||
// Can insert at the end
|
||||
assert((elem == Count()) || IsValidIndex(elem));
|
||||
DbgAssert((elem == Count()) || IsValidIndex(elem));
|
||||
|
||||
GrowVector(num);
|
||||
ShiftElementsRight(elem, num);
|
||||
@ -496,7 +496,7 @@ bool CUtlVector<T>::HasElement(T const &src)
|
||||
template <class T>
|
||||
void CUtlVector<T>::FastRemove(int elem)
|
||||
{
|
||||
assert(IsValidIndex(elem));
|
||||
DbgAssert(IsValidIndex(elem));
|
||||
|
||||
Destruct(&Element(elem));
|
||||
if (m_Size > 0)
|
||||
@ -527,8 +527,8 @@ void CUtlVector<T>::FindAndRemove(T const &src)
|
||||
template <class T>
|
||||
void CUtlVector<T>::RemoveMultiple(int elem, int num)
|
||||
{
|
||||
assert(IsValidIndex(elem));
|
||||
assert(elem + num <= Count());
|
||||
DbgAssert(IsValidIndex(elem));
|
||||
DbgAssert(elem + num <= Count());
|
||||
|
||||
for (int i = elem + num; --i >= elem;)
|
||||
Destruct(&Element(i));
|
||||
|
Loading…
Reference in New Issue
Block a user