mirror of
https://github.com/rehlds/rehlds.git
synced 2024-12-29 08:05:50 +03:00
Refactoring
Fix crash on SV_SingleClipMoveToEntity, added safe check for pointer model
This commit is contained in:
parent
4094d8d633
commit
4fc947807f
@ -51,7 +51,7 @@ task publishPrepareFiles {
|
||||
copy {
|
||||
from 'rehlds/public'
|
||||
into 'publish/publishRoot/hlsdk/public'
|
||||
include 'interface.h', 'interface.cpp', 'FileSystem.h'
|
||||
exclude '**/rehlds/*', '**/tier0/*'
|
||||
}
|
||||
copy {
|
||||
from 'rehlds/public/rehlds'
|
||||
|
@ -25,15 +25,19 @@
|
||||
#define MAX_LIGHTSTYLE_INDEX_BITS 6
|
||||
#define MAX_LIGHTSTYLES (1<<MAX_LIGHTSTYLE_INDEX_BITS)
|
||||
|
||||
// Resource counts;
|
||||
// Resource counts
|
||||
#define MAX_MODEL_INDEX_BITS 9 // sent as a short
|
||||
#define MAX_MODELS (1<<MAX_MODEL_INDEX_BITS)
|
||||
#define MAX_SOUND_INDEX_BITS 9
|
||||
#define MAX_SOUNDS (1<<MAX_SOUND_INDEX_BITS)
|
||||
#define MAX_SOUNDS_HASHLOOKUP_SIZE (MAX_SOUNDS * 2 - 1)
|
||||
|
||||
#define MAX_GENERIC_INDEX_BITS 9
|
||||
#define MAX_GENERIC (1<<MAX_GENERIC_INDEX_BITS)
|
||||
#define MAX_DECAL_INDEX_BITS 9
|
||||
#define MAX_BASE_DECALS (1<<MAX_DECAL_INDEX_BITS)
|
||||
|
||||
#define MAX_EVENTS 256
|
||||
#define MAX_PACKET_ENTITIES 256 // 256 visible entities per frame
|
||||
|
||||
#endif // QLIMITS_H
|
||||
|
@ -226,10 +226,10 @@ typedef struct client_state_s
|
||||
local_state_t predicted_frames[64];
|
||||
int delta_sequence;
|
||||
int playernum;
|
||||
event_t event_precache[HL_EVENT_MAX];
|
||||
model_t *model_precache[HL_MODEL_MAX];
|
||||
event_t event_precache[MAX_EVENTS];
|
||||
model_t *model_precache[MAX_MODELS];
|
||||
int model_precache_count;
|
||||
sfx_s *sound_precache[HL_SOUND_MAX];
|
||||
sfx_s *sound_precache[MAX_SOUNDS];
|
||||
consistency_t consistency_list[MAX_CONSISTENCY_LIST];
|
||||
int num_consistency;
|
||||
int highentity;
|
||||
|
@ -84,8 +84,8 @@ void COM_ClearCustomizationList(customization_t *pHead, qboolean bCleanDecals)
|
||||
|
||||
qboolean COM_CreateCustomization(customization_t *pListHead, resource_t *pResource, int playernumber, int flags, customization_t **pCustomization, int *nLumps)
|
||||
{
|
||||
customization_t *pCust; // 91
|
||||
qboolean bError; // 92
|
||||
customization_t *pCust;
|
||||
qboolean bError;
|
||||
|
||||
bError = FALSE;
|
||||
if (pCustomization)
|
||||
|
@ -311,7 +311,7 @@ static delta_definition_t g_ClientDataDefinition[] =
|
||||
DELTA_DEF(clientdata_s, vuser4[2]),
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // Delta_definitions_region
|
||||
|
||||
delta_description_t *DELTA_FindField(delta_t *pFields, const char *pszField)
|
||||
{
|
||||
@ -760,7 +760,6 @@ qboolean DELTA_WriteDeltaForceMask(unsigned char *from, unsigned char *to, qbool
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
qboolean _DELTA_WriteDelta(unsigned char *from, unsigned char *to, qboolean force, delta_t *pFields, void(*callback)( void ), qboolean sendfields)
|
||||
{
|
||||
int i;
|
||||
@ -790,7 +789,6 @@ qboolean _DELTA_WriteDelta(unsigned char *from, unsigned char *to, qboolean forc
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int DELTA_ParseDelta(unsigned char *from, unsigned char *to, delta_t *pFields)
|
||||
{
|
||||
delta_description_t *pTest;
|
||||
|
@ -132,7 +132,7 @@ NOXREF void Host_EndGame(const char *message, ...)
|
||||
longjmp(host_abortserver, 1);
|
||||
}
|
||||
|
||||
void __declspec(noreturn) Host_Error(const char *error, ...)
|
||||
void NORETURN Host_Error(const char *error, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char string[1024];
|
||||
|
@ -117,7 +117,7 @@ extern jmp_buf host_enddemo;
|
||||
extern unsigned short *host_basepal;
|
||||
|
||||
NOXREF void Host_EndGame(const char *message, ...);
|
||||
void __declspec(noreturn) Host_Error(const char *error, ...);
|
||||
void NORETURN Host_Error(const char *error, ...);
|
||||
void Host_InitLocal(void);
|
||||
NOBODY void Info_WriteVars(FileHandle_t fp);
|
||||
void Host_WriteConfiguration(void);
|
||||
|
@ -403,7 +403,6 @@ void Mod_AdSwap(texture_t *src, int pixels, int entries)
|
||||
if (!tested)
|
||||
return;
|
||||
|
||||
int j;
|
||||
uint8 *mippal;
|
||||
uint16 *texpal;
|
||||
texture_t *tex;
|
||||
@ -1895,3 +1894,24 @@ NOXREF void Mod_ChangeGame(void)
|
||||
p->initialCRC = 0;
|
||||
}
|
||||
}
|
||||
|
||||
model_t *Mod_Handle(int modelindex)
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
if (modelindex <= 0 || modelindex >= MAX_MODELS) {
|
||||
Sys_Error(__FUNCTION__ ": bad modelindex #%i\n", modelindex);
|
||||
}
|
||||
#endif
|
||||
|
||||
return g_psv.models[modelindex];
|
||||
}
|
||||
|
||||
modtype_t Mod_GetType(int modelindex)
|
||||
{
|
||||
model_t *mod = Mod_Handle(modelindex);
|
||||
if (!mod) {
|
||||
return mod_bad;
|
||||
}
|
||||
|
||||
return mod->type;
|
||||
}
|
||||
|
@ -114,3 +114,5 @@ void Mod_LoadSpriteModel(model_t *mod, void *buffer);
|
||||
NOXREF void Mod_UnloadSpriteTextures(model_t *pModel);
|
||||
void Mod_Print(void);
|
||||
NOXREF void Mod_ChangeGame(void);
|
||||
model_t *Mod_Handle(int modelindex);
|
||||
modtype_t Mod_GetType(int modelindex);
|
||||
|
@ -277,7 +277,10 @@ int _PM_TestPlayerPosition(vec_t *pos, pmtrace_t *ptrace, int(*pfnIgnore)(physen
|
||||
for (int i = 0; i < pmove->numphysent; i++)
|
||||
{
|
||||
physent_t *pe = &pmove->physents[i];
|
||||
if (pfnIgnore && pfnIgnore(pe) || pe->model && !pe->solid && pe->skin)
|
||||
if (pfnIgnore && pfnIgnore(pe))
|
||||
continue;
|
||||
|
||||
if (pe->model && pe->solid == SOLID_NOT && pe->skin != 0)
|
||||
continue;
|
||||
|
||||
offset[0] = pe->origin[0];
|
||||
@ -291,7 +294,7 @@ int _PM_TestPlayerPosition(vec_t *pos, pmtrace_t *ptrace, int(*pfnIgnore)(physen
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pe->studiomodel && pe->studiomodel->type == mod_studio && ((pe->studiomodel->flags & 0x200) || pmove->usehull == 2))
|
||||
if (pe->studiomodel && pe->studiomodel->type == mod_studio && ((pe->studiomodel->flags & STUDIO_TRACE_HITBOX) || pmove->usehull == 2))
|
||||
{
|
||||
hull = PM_HullForStudioModel(pe->studiomodel, offset, pe->frame, pe->sequence, pe->angles, pe->origin, pe->controller, pe->blending, &numhulls);
|
||||
}
|
||||
@ -309,7 +312,7 @@ int _PM_TestPlayerPosition(vec_t *pos, pmtrace_t *ptrace, int(*pfnIgnore)(physen
|
||||
test[0] = pos[0] - offset[0];
|
||||
test[1] = pos[1] - offset[1];
|
||||
test[2] = pos[2] - offset[2];
|
||||
if (pe->solid == 4 && (pe->angles[0] != 0.0 || pe->angles[1] != 0.0 || pe->angles[2] != 0.0))
|
||||
if (pe->solid == SOLID_BSP && (pe->angles[0] != 0.0 || pe->angles[1] != 0.0 || pe->angles[2] != 0.0))
|
||||
{
|
||||
vec3_t forward, right, up;
|
||||
AngleVectors(pe->angles, forward, right, up);
|
||||
@ -324,14 +327,14 @@ int _PM_TestPlayerPosition(vec_t *pos, pmtrace_t *ptrace, int(*pfnIgnore)(physen
|
||||
for (int j = 0; j < numhulls; j++)
|
||||
{
|
||||
g_contentsresult = PM_HullPointContents(&hull[j], hull[j].firstclipnode, test);
|
||||
if (g_contentsresult == -2)
|
||||
if (g_contentsresult == CONTENTS_SOLID)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_contentsresult = PM_HullPointContents(hull, hull->firstclipnode, test);
|
||||
if (g_contentsresult == -2)
|
||||
if (g_contentsresult == CONTENTS_SOLID)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ void EXT_FUNC PF_setmodel_I(edict_t *e, const char *m)
|
||||
int i = 0;
|
||||
|
||||
#ifdef REHLDS_CHECKS
|
||||
for (; *check && i < HL_MODEL_MAX; i++, check++)
|
||||
for (; *check && i < MAX_MODELS; i++, check++)
|
||||
#else
|
||||
for (; *check; i++, check++)
|
||||
#endif
|
||||
@ -287,7 +287,7 @@ void EXT_FUNC PF_ambientsound_I(edict_t *entity, float *pos, const char *samp, f
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < HL_SOUND_MAX; i++)
|
||||
for (i = 0; i < MAX_SOUNDS; i++)
|
||||
{
|
||||
if (g_psv.sound_precache[i] && !Q_stricmp(g_psv.sound_precache[i], samp))
|
||||
{
|
||||
@ -296,7 +296,7 @@ void EXT_FUNC PF_ambientsound_I(edict_t *entity, float *pos, const char *samp, f
|
||||
}
|
||||
}
|
||||
|
||||
if (i == HL_SOUND_MAX)
|
||||
if (i == MAX_SOUNDS)
|
||||
{
|
||||
Con_Printf("no precache: %s\n", samp);
|
||||
return;
|
||||
@ -1023,19 +1023,19 @@ int EXT_FUNC PF_precache_sound_I(const char *s)
|
||||
int i;
|
||||
|
||||
if (!s)
|
||||
Host_Error("PF_precache_sound_I: NULL pointer");
|
||||
Host_Error(__FUNCTION__ ": NULL pointer");
|
||||
|
||||
if (PR_IsEmptyString(s))
|
||||
Host_Error("PF_precache_sound_I: Bad string '%s'", s);
|
||||
Host_Error(__FUNCTION__ ": Bad string '%s'", s);
|
||||
|
||||
if (s[0] == '!')
|
||||
Host_Error("PF_precache_sound_I: '%s' do not precache sentence names!", s);
|
||||
Host_Error(__FUNCTION__ ": '%s' do not precache sentence names!", s);
|
||||
|
||||
if (g_psv.state == ss_loading)
|
||||
{
|
||||
g_psv.sound_precache_hashedlookup_built = 0;
|
||||
|
||||
for (i = 0; i < HL_SOUND_MAX; i++)
|
||||
for (i = 0; i < MAX_SOUNDS; i++)
|
||||
{
|
||||
if (!g_psv.sound_precache[i])
|
||||
{
|
||||
@ -1053,42 +1053,42 @@ int EXT_FUNC PF_precache_sound_I(const char *s)
|
||||
}
|
||||
|
||||
Host_Error(
|
||||
"PF_precache_sound_I: Sound '%s' failed to precache because the item count is over the %d limit.\nReduce the number of brush models and/or regular models in the map to correct this.",
|
||||
s,
|
||||
HL_SOUND_MAX);
|
||||
__FUNCTION__ ": Sound '%s' failed to precache because the item count is over the %d limit.\nReduce the number of brush models and/or regular models in the map to correct this.",
|
||||
s, MAX_SOUNDS);
|
||||
}
|
||||
else
|
||||
{
|
||||
// precaching not enabled. check if already exists.
|
||||
for (i = 0; i < HL_SOUND_MAX; i++)
|
||||
for (i = 0; i < MAX_SOUNDS; i++)
|
||||
{
|
||||
if (g_psv.sound_precache[i] && !Q_stricmp(g_psv.sound_precache[i], s))
|
||||
return i;
|
||||
}
|
||||
|
||||
Host_Error("PF_precache_sound_I: '%s' Precache can only be done in spawn functions", s);
|
||||
Host_Error(__FUNCTION__ ": '%s' Precache can only be done in spawn functions", s);
|
||||
}
|
||||
|
||||
return -1; // unreach
|
||||
// unreach
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned short EXT_FUNC EV_Precache(int type, const char *psz)
|
||||
{
|
||||
if (!psz)
|
||||
Host_Error("EV_Precache: NULL pointer");
|
||||
Host_Error(__FUNCTION__ ": NULL pointer");
|
||||
|
||||
if (PR_IsEmptyString(psz))
|
||||
Host_Error("EV_Precache: Bad string '%s'", psz);
|
||||
Host_Error(__FUNCTION__ ": Bad string '%s'", psz);
|
||||
|
||||
if (g_psv.state == ss_loading)
|
||||
{
|
||||
for (int i = 1; i < HL_EVENT_MAX; i++)
|
||||
for (int i = 1; i < MAX_EVENTS; i++)
|
||||
{
|
||||
struct event_s* ev = &g_psv.event_precache[i];
|
||||
if (!ev->filename)
|
||||
{
|
||||
if (type != 1)
|
||||
Host_Error("EV_Precache: only file type 1 supported currently\n");
|
||||
Host_Error(__FUNCTION__ ": only file type 1 supported currently\n");
|
||||
|
||||
char szpath[MAX_PATH];
|
||||
Q_snprintf(szpath, sizeof(szpath), "%s", psz);
|
||||
@ -1097,7 +1097,7 @@ unsigned short EXT_FUNC EV_Precache(int type, const char *psz)
|
||||
int scriptSize = 0;
|
||||
char* evScript = (char*) COM_LoadFile(szpath, 5, &scriptSize);
|
||||
if (!evScript)
|
||||
Host_Error("EV_Precache: file %s missing from server\n", psz);
|
||||
Host_Error(__FUNCTION__ ": file %s missing from server\n", psz);
|
||||
#ifdef REHLDS_FIXES
|
||||
// Many modders don't know that the resource names passed to precache functions must be a static strings.
|
||||
// Also some metamod modules can be unloaded during the server running.
|
||||
@ -1117,18 +1117,18 @@ unsigned short EXT_FUNC EV_Precache(int type, const char *psz)
|
||||
if (!Q_stricmp(ev->filename, psz))
|
||||
return i;
|
||||
}
|
||||
Host_Error("EV_Precache: '%s' overflow", psz);
|
||||
Host_Error(__FUNCTION__ ": '%s' overflow", psz);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 1; i < HL_EVENT_MAX; i++)
|
||||
for (int i = 1; i < MAX_EVENTS; i++)
|
||||
{
|
||||
struct event_s* ev = &g_psv.event_precache[i];
|
||||
if (!Q_stricmp(ev->filename, psz))
|
||||
return i;
|
||||
}
|
||||
|
||||
Host_Error("EV_Precache: '%s' Precache can only be done in spawn functions", psz);
|
||||
Host_Error(__FUNCTION__ ": '%s' Precache can only be done in spawn functions", psz);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1219,15 +1219,15 @@ void EXT_FUNC EV_Playback(int flags, const edict_t *pInvoker, unsigned short eve
|
||||
eargs.bparam1 = bparam1;
|
||||
eargs.bparam2 = bparam2;
|
||||
|
||||
if (eventindex < 1u || eventindex >= HL_EVENT_MAX)
|
||||
if (eventindex < 1u || eventindex >= MAX_EVENTS)
|
||||
{
|
||||
Con_DPrintf("EV_Playback: index out of range %i\n", eventindex);
|
||||
Con_DPrintf(__FUNCTION__ ": index out of range %i\n", eventindex);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!g_psv.event_precache[eventindex].pszScript)
|
||||
{
|
||||
Con_DPrintf("EV_Playback: no event for index %i\n", eventindex);
|
||||
Con_DPrintf(__FUNCTION__ ": no event for index %i\n", eventindex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1358,7 +1358,7 @@ void EXT_FUNC EV_SV_Playback(int flags, int clientindex, unsigned short eventind
|
||||
return;
|
||||
|
||||
if (clientindex < 0 || clientindex >= g_psvs.maxclients)
|
||||
Host_Error("EV_SV_Playback: Client index %i out of range\n", clientindex);
|
||||
Host_Error(__FUNCTION__ ": Client index %i out of range\n", clientindex);
|
||||
|
||||
edict_t *pEdict = g_psvs.clients[clientindex].edict;
|
||||
EV_Playback(flags,pEdict, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2);
|
||||
@ -1376,7 +1376,7 @@ int SV_LookupModelIndex(const char *name)
|
||||
return node->val;
|
||||
}
|
||||
#else // REHLDS_OPT_PEDANTIC
|
||||
for (int i = 0; i < HL_MODEL_MAX; i++)
|
||||
for (int i = 0; i < MAX_MODELS; i++)
|
||||
{
|
||||
if (!g_psv.model_precache[i])
|
||||
break;
|
||||
@ -1394,10 +1394,10 @@ int EXT_FUNC PF_precache_model_I(const char *s)
|
||||
{
|
||||
int iOptional = 0;
|
||||
if (!s)
|
||||
Host_Error("PF_precache_model_I: NULL pointer");
|
||||
Host_Error(__FUNCTION__ ": NULL pointer");
|
||||
|
||||
if (PR_IsEmptyString(s))
|
||||
Host_Error("PF_precache_model_I: Bad string '%s'", s);
|
||||
Host_Error(__FUNCTION__ ": Bad string '%s'", s);
|
||||
|
||||
if (*s == '!')
|
||||
{
|
||||
@ -1407,7 +1407,7 @@ int EXT_FUNC PF_precache_model_I(const char *s)
|
||||
|
||||
if (g_psv.state == ss_loading)
|
||||
{
|
||||
for (int i = 0; i < HL_MODEL_MAX; i++)
|
||||
for (int i = 0; i < MAX_MODELS; i++)
|
||||
{
|
||||
if (!g_psv.model_precache[i])
|
||||
{
|
||||
@ -1422,14 +1422,14 @@ int EXT_FUNC PF_precache_model_I(const char *s)
|
||||
g_rehlds_sv.modelsMap.put(g_psv.model_precache[i], i);
|
||||
#endif //REHLDS_OPT_PEDANTIC
|
||||
|
||||
g_psv.models[i] = Mod_ForName(s, 1, 1);
|
||||
g_psv.models[i] = Mod_ForName(s, TRUE, TRUE);
|
||||
if (!iOptional)
|
||||
g_psv.model_precache_flags[i] |= 1u;
|
||||
g_psv.model_precache_flags[i] |= RES_FATALIFMISSING;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
//use case-sensitive names to increase performance
|
||||
// use case-sensitive names to increase performance
|
||||
#ifdef REHLDS_FIXES
|
||||
if (!Q_strcmp(g_psv.model_precache[i], s))
|
||||
return i;
|
||||
@ -1439,15 +1439,14 @@ int EXT_FUNC PF_precache_model_I(const char *s)
|
||||
#endif
|
||||
}
|
||||
Host_Error(
|
||||
"PF_precache_model_I: Model '%s' failed to precache because the item count is over the %d limit.\nReduce the number of brush models and/or regular models in the map to correct this.",
|
||||
s,
|
||||
512);
|
||||
__FUNCTION__ ": Model '%s' failed to precache because the item count is over the %d limit.\nReduce the number of brush models and/or regular models in the map to correct this.",
|
||||
s, MAX_MODELS);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < HL_MODEL_MAX; i++)
|
||||
for (int i = 0; i < MAX_MODELS; i++)
|
||||
{
|
||||
//use case-sensitive names to increase performance
|
||||
// use case-sensitive names to increase performance
|
||||
#ifdef REHLDS_FIXES
|
||||
if (!Q_strcmp(g_psv.model_precache[i], s))
|
||||
return i;
|
||||
@ -1456,19 +1455,21 @@ int EXT_FUNC PF_precache_model_I(const char *s)
|
||||
return i;
|
||||
#endif
|
||||
}
|
||||
Host_Error("PF_precache_model_I: '%s' Precache can only be done in spawn functions", s);
|
||||
Host_Error(__FUNCTION__ ": '%s' Precache can only be done in spawn functions", s);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
int EXT_FUNC PF_precache_generic_I(char *s)
|
||||
// TODO: Call to Con_Printf is replaced with Host_Error in 6153
|
||||
{
|
||||
if (!s)
|
||||
Host_Error("PF_precache_generic_I: NULL pointer");
|
||||
Host_Error(__FUNCTION__ ": NULL pointer");
|
||||
|
||||
if (PR_IsEmptyString(s))
|
||||
Host_Error("PF_precache_generic_I: Bad string '%s'", s);
|
||||
{
|
||||
// TODO: Call to Con_Printf is replaced with Host_Error in 6153
|
||||
Host_Error(__FUNCTION__ ": Bad string '%s'", s);
|
||||
}
|
||||
|
||||
char resName[MAX_QPATH];
|
||||
Q_strncpy(resName, s, sizeof(resName));
|
||||
@ -1492,14 +1493,15 @@ int EXT_FUNC PF_precache_generic_I(char *s)
|
||||
}
|
||||
|
||||
if (g_psv.state != ss_loading)
|
||||
Host_Error("PF_precache_generic_I: '%s' Precache can only be done in spawn functions", resName);
|
||||
Host_Error(__FUNCTION__ ": '%s' Precache can only be done in spawn functions", resName);
|
||||
|
||||
if (resCount >= ARRAYSIZE(g_rehlds_sv.precachedGenericResourceNames))
|
||||
{
|
||||
Host_Error(
|
||||
"PF_precache_generic_I: Generic item '%s' failed to precache because the item count is over the %d limit.\n\
|
||||
__FUNCTION__ ": Generic item '%s' failed to precache because the item count is over the %d limit.\n\
|
||||
Reduce the number of brush models and/or regular models in the map to correct this.",
|
||||
resName,
|
||||
ARRAYSIZE(g_rehlds_sv.precachedGenericResourceNames));
|
||||
resName, ARRAYSIZE(g_rehlds_sv.precachedGenericResourceNames));
|
||||
}
|
||||
|
||||
Q_strcpy(g_rehlds_sv.precachedGenericResourceNames[resCount], resName);
|
||||
|
||||
@ -1507,17 +1509,19 @@ Reduce the number of brush models and/or regular models in the map to correct th
|
||||
}
|
||||
#else // REHLDS_FIXES
|
||||
int EXT_FUNC PF_precache_generic_I(char *s)
|
||||
// TODO: Call to Con_Printf is replaced with Host_Error in 6153
|
||||
{
|
||||
if (!s)
|
||||
Host_Error("PF_precache_generic_I: NULL pointer");
|
||||
Host_Error(__FUNCTION__ ": NULL pointer");
|
||||
|
||||
if (PR_IsEmptyString(s))
|
||||
Host_Error("PF_precache_generic_I: Bad string '%s'", s);
|
||||
{
|
||||
// TODO: Call to Con_Printf is replaced with Host_Error in 6153
|
||||
Host_Error(__FUNCTION__ ": Bad string '%s'", s);
|
||||
}
|
||||
|
||||
if (g_psv.state == ss_loading)
|
||||
{
|
||||
for (int i = 0; i < HL_GENERIC_MAX; i++)
|
||||
for (int i = 0; i < MAX_GENERIC; i++)
|
||||
{
|
||||
if (!g_psv.generic_precache[i])
|
||||
{
|
||||
@ -1529,18 +1533,18 @@ int EXT_FUNC PF_precache_generic_I(char *s)
|
||||
return i;
|
||||
}
|
||||
Host_Error(
|
||||
"PF_precache_generic_I: Generic item '%s' failed to precache because the item count is over the %d limit.\nReduce the number of brush models and/or regular models in the map to correct this.",
|
||||
s,
|
||||
HL_GENERIC_MAX);
|
||||
__FUNCTION__ ": Generic item '%s' failed to precache because the item count is over the %d limit.\nReduce the number of brush models and/or regular models in the map to correct this.",
|
||||
s, MAX_GENERIC
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < HL_GENERIC_MAX; i++)
|
||||
for (int i = 0; i < MAX_GENERIC; i++)
|
||||
{
|
||||
if (!Q_stricmp(g_psv.generic_precache[i], s))
|
||||
return i;
|
||||
}
|
||||
Host_Error("PF_precache_generic_I: '%s' Precache can only be done in spawn functions", s);
|
||||
Host_Error(__FUNCTION__ ": '%s' Precache can only be done in spawn functions", s);
|
||||
}
|
||||
}
|
||||
#endif // REHLDS_FIXES
|
||||
@ -1975,13 +1979,13 @@ edict_t* EXT_FUNC PF_CreateFakeClient_I(const char *netname)
|
||||
Q_strncpy(fakeclient->name, netname, sizeof(fakeclient->name) - 1);
|
||||
fakeclient->name[sizeof(fakeclient->name) - 1] = 0;
|
||||
|
||||
fakeclient->active = 1;
|
||||
fakeclient->spawned = 1;
|
||||
fakeclient->fully_connected = 1;
|
||||
fakeclient->connected = 1;
|
||||
fakeclient->fakeclient = 1;
|
||||
fakeclient->active = TRUE;
|
||||
fakeclient->spawned = TRUE;
|
||||
fakeclient->fully_connected = TRUE;
|
||||
fakeclient->connected = TRUE;
|
||||
fakeclient->fakeclient = TRUE;
|
||||
fakeclient->userid = g_userid++;
|
||||
fakeclient->uploading = 0;
|
||||
fakeclient->uploading = FALSE;
|
||||
fakeclient->edict = ent;
|
||||
ent->v.netname = (size_t)fakeclient->name - (size_t)pr_strings;
|
||||
ent->v.pContainingEntity = ent;
|
||||
|
@ -37,7 +37,6 @@
|
||||
// TODO: I think this defines must be in /common/
|
||||
#define NUM_EDICTS 900
|
||||
#define MAX_NAME 32
|
||||
#define MAX_PACKET_ENTITIES 256
|
||||
|
||||
#include "custom_int.h"
|
||||
#include "crc.h"
|
||||
@ -86,13 +85,6 @@
|
||||
#define RESOURCE_MAX_COUNT (1 << RESOURCE_INDEX_BITS)
|
||||
#endif // REHLDS_FIXES
|
||||
|
||||
#define HL_SOUND_MAX 512
|
||||
#define HL_SOUND_HASHLOOKUP_SIZE (HL_SOUND_MAX * 2 - 1)
|
||||
|
||||
#define HL_MODEL_MAX 512
|
||||
#define HL_GENERIC_MAX 512
|
||||
#define HL_EVENT_MAX 256
|
||||
|
||||
typedef enum redirect_e
|
||||
{
|
||||
RD_NONE = 0,
|
||||
@ -127,15 +119,15 @@ typedef struct server_s
|
||||
int num_resources;
|
||||
consistency_t consistency_list[MAX_CONSISTENCY_LIST];
|
||||
int num_consistency;
|
||||
const char *model_precache[HL_MODEL_MAX];
|
||||
struct model_s *models[HL_MODEL_MAX];
|
||||
unsigned char model_precache_flags[HL_MODEL_MAX];
|
||||
struct event_s event_precache[HL_EVENT_MAX];
|
||||
const char *sound_precache[HL_SOUND_MAX];
|
||||
short int sound_precache_hashedlookup[HL_SOUND_HASHLOOKUP_SIZE];
|
||||
const char *model_precache[MAX_MODELS];
|
||||
struct model_s *models[MAX_MODELS];
|
||||
unsigned char model_precache_flags[MAX_MODELS];
|
||||
struct event_s event_precache[MAX_EVENTS];
|
||||
const char *sound_precache[MAX_SOUNDS];
|
||||
short int sound_precache_hashedlookup[MAX_SOUNDS_HASHLOOKUP_SIZE];
|
||||
qboolean sound_precache_hashedlookup_built;
|
||||
const char *generic_precache[HL_GENERIC_MAX];
|
||||
char generic_precache_names[HL_GENERIC_MAX][64];
|
||||
const char *generic_precache[MAX_GENERIC];
|
||||
char generic_precache_names[MAX_GENERIC][64];
|
||||
int num_generic_names;
|
||||
char *lightstyles[MAX_LIGHTSTYLES];
|
||||
int num_edicts;
|
||||
@ -158,11 +150,11 @@ typedef struct server_s
|
||||
|
||||
|
||||
struct rehlds_server_t {
|
||||
//map for sv.model_precache (for faster resolving of model index by its name)
|
||||
// map for sv.model_precache (for faster resolving of model index by its name)
|
||||
#if defined(REHLDS_FIXES)
|
||||
CStringKeyStaticMap<int, 7, HL_MODEL_MAX * 2> modelsMap; //case-sensitive keys for better performance
|
||||
CStringKeyStaticMap<int, 7, MAX_MODELS * 2> modelsMap; // case-sensitive keys for better performance
|
||||
#elif defined(REHLDS_OPT_PEDANTIC)
|
||||
CICaseStringKeyStaticMap<int, 7, HL_MODEL_MAX * 2> modelsMap; //use case-insensitive keys to conform original engine's behavior
|
||||
CICaseStringKeyStaticMap<int, 7, MAX_MODELS * 2> modelsMap; // use case-insensitive keys to conform original engine's behavior
|
||||
#endif
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
|
@ -692,12 +692,12 @@ void SV_FindModelNumbers(void)
|
||||
{
|
||||
sv_playermodel = -1;
|
||||
|
||||
for (int i = 0; i < HL_MODEL_MAX; i++)
|
||||
for (int i = 0; i < MAX_MODELS; i++)
|
||||
{
|
||||
if (!g_psv.model_precache[i])
|
||||
break;
|
||||
|
||||
//use case-sensitive names to increase performance
|
||||
// use case-sensitive names to increase performance
|
||||
#ifdef REHLDS_FIXES
|
||||
if (!Q_stricmp(g_psv.model_precache[i], "models/player.mdl"))
|
||||
sv_playermodel = i;
|
||||
@ -869,7 +869,7 @@ int EXT_FUNC SV_LookupSoundIndex(const char *sample)
|
||||
{
|
||||
if (g_psv.state == ss_loading)
|
||||
{
|
||||
for (index = 1; index < HL_SOUND_MAX && g_psv.sound_precache[index]; index++) // TODO: why from 1?
|
||||
for (index = 1; index < MAX_SOUNDS && g_psv.sound_precache[index]; index++) // TODO: why from 1?
|
||||
{
|
||||
if (!Q_stricmp(sample, g_psv.sound_precache[index]))
|
||||
return index;
|
||||
@ -887,7 +887,7 @@ int EXT_FUNC SV_LookupSoundIndex(const char *sample)
|
||||
return g_psv.sound_precache_hashedlookup[index];
|
||||
|
||||
index++;
|
||||
if (index >= HL_SOUND_HASHLOOKUP_SIZE)
|
||||
if (index >= MAX_SOUNDS_HASHLOOKUP_SIZE)
|
||||
index = 0;
|
||||
if (index == starting_index)
|
||||
return 0;
|
||||
@ -899,7 +899,7 @@ void SV_BuildHashedSoundLookupTable(void)
|
||||
{
|
||||
Q_memset(g_psv.sound_precache_hashedlookup, 0, sizeof(g_psv.sound_precache_hashedlookup));
|
||||
|
||||
for (int sound_num = 0; sound_num < HL_SOUND_MAX; sound_num++)
|
||||
for (int sound_num = 0; sound_num < MAX_SOUNDS; sound_num++)
|
||||
{
|
||||
if (!g_psv.sound_precache[sound_num])
|
||||
break;
|
||||
@ -912,14 +912,14 @@ void SV_BuildHashedSoundLookupTable(void)
|
||||
|
||||
void SV_AddSampleToHashedLookupTable(const char *pszSample, int iSampleIndex)
|
||||
{
|
||||
int starting_index = SV_HashString(pszSample, HL_SOUND_HASHLOOKUP_SIZE);
|
||||
int starting_index = SV_HashString(pszSample, MAX_SOUNDS_HASHLOOKUP_SIZE);
|
||||
int index = starting_index;
|
||||
while (g_psv.sound_precache_hashedlookup[index])
|
||||
{
|
||||
index++;
|
||||
hashstrings_collisions++;
|
||||
|
||||
if (index >= HL_SOUND_HASHLOOKUP_SIZE)
|
||||
if (index >= MAX_SOUNDS_HASHLOOKUP_SIZE)
|
||||
index = 0;
|
||||
|
||||
if (index == starting_index)
|
||||
@ -1413,8 +1413,8 @@ void SV_WriteSpawn(sizebuf_t *msg)
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
// do it before PutInServer to allow mods send messages from forward
|
||||
SZ_Clear( &host_client->netchan.message );
|
||||
SZ_Clear( &host_client->datagram );
|
||||
SZ_Clear(&host_client->netchan.message);
|
||||
SZ_Clear(&host_client->datagram);
|
||||
#endif // REHLDS_FIXES
|
||||
|
||||
if (g_psv.loadgame)
|
||||
@ -1492,13 +1492,13 @@ void SV_WriteSpawn(sizebuf_t *msg)
|
||||
MSG_WriteByte(msg, svc_signonnum);
|
||||
MSG_WriteByte(msg, 1);
|
||||
|
||||
host_client->connecttime = 0.0;
|
||||
host_client->ignorecmdtime = 0.0;
|
||||
host_client->cmdtime = 0.0;
|
||||
host_client->active = TRUE;
|
||||
host_client->spawned = TRUE;
|
||||
host_client->connected = TRUE;
|
||||
host_client->fully_connected = FALSE;
|
||||
host_client->connecttime = 0.0;
|
||||
host_client->ignorecmdtime = 0.0;
|
||||
host_client->cmdtime = 0.0;
|
||||
host_client->active = TRUE;
|
||||
host_client->spawned = TRUE;
|
||||
host_client->connected = TRUE;
|
||||
host_client->fully_connected = FALSE;
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
g_GameClients[host_client - g_psvs.clients]->SetSpawnedOnce(true);
|
||||
@ -4976,7 +4976,7 @@ int SV_ModelIndex(const char *name)
|
||||
return node->val;
|
||||
}
|
||||
#else
|
||||
for (int i = 0; i < HL_MODEL_MAX; i++)
|
||||
for (int i = 0; i < MAX_MODELS; i++)
|
||||
{
|
||||
if (!g_psv.model_precache[i])
|
||||
break;
|
||||
@ -5196,7 +5196,7 @@ void SV_CreateResourceList(void)
|
||||
}
|
||||
#else // REHLDS_FIXES
|
||||
#ifdef REHLDS_CHECKS
|
||||
for (i = 1, s = &g_psv.generic_precache[1]; i < HL_GENERIC_MAX && *s != NULL; i++, s++)
|
||||
for (i = 1, s = &g_psv.generic_precache[1]; i < MAX_GENERIC && *s != NULL; i++, s++)
|
||||
#else // REHLDS_CHECKS
|
||||
for (i = 1, s = &g_psv.generic_precache[1]; *s != NULL; i++, s++)
|
||||
#endif // REHLDS_CHECKS
|
||||
@ -5211,7 +5211,7 @@ void SV_CreateResourceList(void)
|
||||
#endif // REHLDS_FIXES
|
||||
|
||||
#ifdef REHLDS_CHECKS
|
||||
for (i = 1, s = &g_psv.sound_precache[1]; i < HL_SOUND_MAX && *s != NULL; i++, s++)
|
||||
for (i = 1, s = &g_psv.sound_precache[1]; i < MAX_SOUNDS && *s != NULL; i++, s++)
|
||||
#else // REHLDS_CHECKS
|
||||
for (i = 1, s = &g_psv.sound_precache[1]; *s != NULL; i++, s++)
|
||||
#endif // REHLDS_CHECKS
|
||||
@ -5233,7 +5233,7 @@ void SV_CreateResourceList(void)
|
||||
}
|
||||
}
|
||||
#ifdef REHLDS_CHECKS
|
||||
for (i = 1, s = &g_psv.model_precache[1]; i < HL_MODEL_MAX && *s != NULL; i++, s++)
|
||||
for (i = 1, s = &g_psv.model_precache[1]; i < MAX_MODELS && *s != NULL; i++, s++)
|
||||
#else // REHLDS_CHECKS
|
||||
for (i = 1, s = &g_psv.model_precache[1]; *s != NULL; i++, s++)
|
||||
#endif // REHLDS_CHECKS
|
||||
@ -5248,7 +5248,7 @@ void SV_CreateResourceList(void)
|
||||
for (i = 0; i < sv_decalnamecount; i++)
|
||||
SV_AddResource(t_decal, sv_decalnames[i].name, Draw_DecalSize(i), 0, i);
|
||||
|
||||
for (i = 1; i < HL_EVENT_MAX; i++)
|
||||
for (i = 1; i < MAX_EVENTS; i++)
|
||||
{
|
||||
ep = &g_psv.event_precache[i];
|
||||
if (!ep->filename)
|
||||
@ -5262,7 +5262,7 @@ void SV_ClearCaches(void)
|
||||
{
|
||||
int i;
|
||||
event_t *ep;
|
||||
for (i = 1; i < HL_EVENT_MAX; i++)
|
||||
for (i = 1; i < MAX_EVENTS; i++)
|
||||
{
|
||||
ep = &g_psv.event_precache[i];
|
||||
if (ep->filename == NULL)
|
||||
@ -5488,7 +5488,6 @@ NOXREF void SV_ReconnectAllClients(void)
|
||||
SV_DropClient(client, FALSE, message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SetCStrikeFlags(void)
|
||||
|
@ -36,24 +36,24 @@
|
||||
static int c_yes = 0;
|
||||
static int c_no = 0;
|
||||
|
||||
#else //HOOK_ENGINE
|
||||
#else // HOOK_ENGINE
|
||||
|
||||
int c_yes;
|
||||
int c_no;
|
||||
|
||||
#endif //HOOK_ENGINE
|
||||
#endif // HOOK_ENGINE
|
||||
|
||||
qboolean SV_CheckBottom(edict_t *ent)
|
||||
{
|
||||
vec3_t mins;
|
||||
vec3_t maxs;
|
||||
vec3_t start;
|
||||
vec3_t stop; // 29
|
||||
trace_t trace; // 30
|
||||
int x; // 31
|
||||
int y; // 31
|
||||
float mid; // 32
|
||||
float bottom; // 32
|
||||
vec3_t stop;
|
||||
trace_t trace;
|
||||
int x;
|
||||
int y;
|
||||
float mid;
|
||||
float bottom;
|
||||
qboolean monsterClip = (ent->v.flags & FL_MONSTERCLIP) ? 1 : 0;
|
||||
|
||||
_VectorAdd(ent->v.origin, ent->v.mins, mins);
|
||||
|
@ -426,10 +426,10 @@ void SV_ParseResourceList(client_t *pSenderClient)
|
||||
resource->nDownloadSize > 1024 * 1024 * 1024) // FIXME: Are they gone crazy??!
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
SV_ClearResourceLists( host_client );
|
||||
SV_ClearResourceLists(host_client);
|
||||
#else // REHLDS_FIXES
|
||||
SV_ClearResourceList( &host_client->resourcesneeded );
|
||||
SV_ClearResourceList( &host_client->resourcesonhand );
|
||||
SV_ClearResourceList(&host_client->resourcesneeded);
|
||||
SV_ClearResourceList(&host_client->resourcesonhand);
|
||||
#endif // REHLDS_FIXES
|
||||
return;
|
||||
}
|
||||
@ -488,14 +488,13 @@ void SV_ParseResourceList(client_t *pSenderClient)
|
||||
Con_DPrintf("----------------------\n");
|
||||
|
||||
int bytestodownload = SV_EstimateNeededResources();
|
||||
|
||||
if (bytestodownload > sv_max_upload.value * 1024 * 1024)
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
SV_ClearResourceLists( host_client );
|
||||
SV_ClearResourceLists(host_client);
|
||||
#else // REHLDS_FIXES
|
||||
SV_ClearResourceList( &host_client->resourcesneeded );
|
||||
SV_ClearResourceList( &host_client->resourcesonhand );
|
||||
SV_ClearResourceList(&host_client->resourcesneeded);
|
||||
SV_ClearResourceList(&host_client->resourcesonhand);
|
||||
#endif //REHLDS_FIXES
|
||||
return;
|
||||
}
|
||||
|
@ -1533,7 +1533,6 @@ void SV_ParseMove(client_t *pSenderClient)
|
||||
if (!g_psv.active || !(host_client->active || host_client->spawned))
|
||||
return;
|
||||
|
||||
|
||||
if (msg_badread)
|
||||
{
|
||||
Con_Printf("Client %s:%s sent a bogus command packet\n", host_client->name, NET_AdrToString(host_client->netchan.remote_address));
|
||||
@ -1807,7 +1806,7 @@ void SV_SendEnts_f(void)
|
||||
{
|
||||
if (host_client->connected)
|
||||
{
|
||||
host_client->fully_connected = 1;
|
||||
host_client->fully_connected = TRUE;
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
// See SV_CheckFile function
|
||||
|
@ -428,7 +428,7 @@ NOBODY void Sys_DebugOutStraight(const char *pStr);
|
||||
//{
|
||||
//}
|
||||
|
||||
void __declspec(noreturn) Sys_Error(const char *error, ...)
|
||||
void NORETURN Sys_Error(const char *error, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char text[1024];
|
||||
|
@ -160,7 +160,7 @@ NOBODY void MaskExceptions(void);
|
||||
NOBODY void Sys_Init(void);
|
||||
NOXREF void Sys_Sleep(int msec);
|
||||
NOBODY void Sys_DebugOutStraight(const char *pStr);
|
||||
NOBODY void __declspec(noreturn) Sys_Error(const char *error, ...);
|
||||
NOBODY void NORETURN Sys_Error(const char *error, ...);
|
||||
NOXREF void Sys_Warning(const char *pszWarning, ...);
|
||||
void Sys_Printf(const char *fmt, ...);
|
||||
void Sys_Quit(void);
|
||||
|
@ -160,11 +160,8 @@ struct hull_s *SV_HullForBsp(edict_t *ent, const vec_t *mins, const vec_t *maxs,
|
||||
model_t *model;
|
||||
hull_t *hull;
|
||||
|
||||
model = g_psv.models[ent->v.modelindex];
|
||||
if (!model)
|
||||
Sys_Error("Hit a %s with no model (%s)", &pr_strings[ent->v.classname], &pr_strings[ent->v.model]);
|
||||
|
||||
if (model->type)
|
||||
model = Mod_Handle(ent->v.modelindex);
|
||||
if (!model || model->type != mod_brush)
|
||||
Sys_Error("Hit a %s with no model (%s)", &pr_strings[ent->v.classname], &pr_strings[ent->v.model]);
|
||||
|
||||
float xSize = maxs[0] - mins[0];
|
||||
@ -310,7 +307,6 @@ void SV_UnlinkEdict(edict_t *ent)
|
||||
void SV_TouchLinks(edict_t *ent, areanode_t *node)
|
||||
{
|
||||
edict_t *touch;
|
||||
model_t *pModel;
|
||||
link_t *next;
|
||||
|
||||
for (link_t *l = node->trigger_edicts.next; l != &node->trigger_edicts; l = next)
|
||||
@ -347,9 +343,7 @@ void SV_TouchLinks(edict_t *ent, areanode_t *node)
|
||||
&& ent->v.absmax[1] >= touch->v.absmin[1]
|
||||
&& ent->v.absmax[2] >= touch->v.absmin[2])
|
||||
{
|
||||
pModel = g_psv.models[touch->v.modelindex];
|
||||
|
||||
if (pModel && pModel->type == mod_brush)
|
||||
if (Mod_GetType(touch->v.modelindex) == mod_brush)
|
||||
{
|
||||
vec3_t offset;
|
||||
hull_t *hull = SV_HullForBsp(touch, ent->v.mins, ent->v.maxs, offset);
|
||||
@ -560,40 +554,39 @@ void SV_LinkEdict(edict_t *ent, qboolean touch_triggers)
|
||||
if (ent->v.solid == SOLID_NOT && ent->v.skin >= -1)
|
||||
return;
|
||||
|
||||
if (ent->v.solid != SOLID_BSP || g_psv.models[ent->v.modelindex] || Q_strlen(&pr_strings[ent->v.model]))
|
||||
{
|
||||
node = sv_areanodes;
|
||||
while (1)
|
||||
{
|
||||
if (node->axis == -1)
|
||||
break;
|
||||
|
||||
if (ent->v.absmin[node->axis] <= node->dist)
|
||||
{
|
||||
if (ent->v.absmax[node->axis] >= node->dist)
|
||||
break;
|
||||
node = node->children[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
node = node->children[0];
|
||||
}
|
||||
}
|
||||
|
||||
InsertLinkBefore(&ent->area, (ent->v.solid == SOLID_TRIGGER) ? &node->trigger_edicts : &node->solid_edicts);
|
||||
if (touch_triggers)
|
||||
{
|
||||
if (!iTouchLinkSemaphore)
|
||||
{
|
||||
iTouchLinkSemaphore = 1;
|
||||
SV_TouchLinks(ent, sv_areanodes);
|
||||
iTouchLinkSemaphore = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ent->v.solid == SOLID_BSP && !Mod_Handle(ent->v.modelindex) && Q_strlen(&pr_strings[ent->v.model]) <= 0)
|
||||
{
|
||||
Con_DPrintf("Inserted %s with no model\n", &pr_strings[ent->v.classname]);
|
||||
return;
|
||||
}
|
||||
|
||||
node = sv_areanodes;
|
||||
while (1)
|
||||
{
|
||||
if (node->axis == -1)
|
||||
break;
|
||||
|
||||
if (ent->v.absmin[node->axis] <= node->dist)
|
||||
{
|
||||
if (ent->v.absmax[node->axis] >= node->dist)
|
||||
break;
|
||||
node = node->children[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
node = node->children[0];
|
||||
}
|
||||
}
|
||||
|
||||
InsertLinkBefore(&ent->area, (ent->v.solid == SOLID_TRIGGER) ? &node->trigger_edicts : &node->solid_edicts);
|
||||
if (touch_triggers)
|
||||
{
|
||||
if (!iTouchLinkSemaphore)
|
||||
{
|
||||
iTouchLinkSemaphore = 1;
|
||||
SV_TouchLinks(ent, sv_areanodes);
|
||||
iTouchLinkSemaphore = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -625,7 +618,6 @@ int SV_LinkContents(areanode_t *node, const vec_t *pos)
|
||||
link_t *l;
|
||||
link_t *next;
|
||||
edict_t *touch;
|
||||
model_t *pModel;
|
||||
hull_t *hull;
|
||||
vec3_t localPosition;
|
||||
vec3_t offset;
|
||||
@ -654,9 +646,8 @@ int SV_LinkContents(areanode_t *node, const vec_t *pos)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
pModel = g_psv.models[touch->v.modelindex];
|
||||
if (pModel
|
||||
&& !pModel->type
|
||||
|
||||
if (Mod_GetType(touch->v.modelindex) == mod_brush
|
||||
&& pos[0] <= (double)touch->v.absmax[0]
|
||||
&& pos[1] <= (double)touch->v.absmax[1]
|
||||
&& pos[2] <= (double)touch->v.absmax[2]
|
||||
@ -1051,7 +1042,12 @@ void SV_SingleClipMoveToEntity(edict_t *ent, const vec_t *start, const vec_t *mi
|
||||
trace->endpos[0] = end[0];
|
||||
trace->endpos[1] = end[1];
|
||||
trace->endpos[2] = end[2];
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
if (Mod_GetType(ent->v.modelindex) == mod_studio)
|
||||
#else
|
||||
if (g_psv.models[ent->v.modelindex]->type == mod_studio)
|
||||
#endif // REHLDS_FIXES
|
||||
{
|
||||
hull = SV_HullForStudioModel(ent, mins, maxs, offset, &numhulls);
|
||||
}
|
||||
|
@ -23,8 +23,8 @@
|
||||
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
|
||||
|
||||
// Keeps clutter down a bit, when using a float as a bit-vector
|
||||
#define SETBITS(flBitVector, bits) ((flBitVector) = (int)(flBitVector) | (bits))
|
||||
#define CLEARBITS(flBitVector, bits) ((flBitVector) = (int)(flBitVector) & ~(bits))
|
||||
#define FBitSet(flBitVector, bit) ((flBitVector) & (bit))
|
||||
#define SetBits(flBitVector, bits) ((flBitVector) = (int)(flBitVector) | (bits))
|
||||
#define ClearBits(flBitVector, bits) ((flBitVector) = (int)(flBitVector) & ~(bits))
|
||||
#define FBitSet(flBitVector, bit) ((int)(flBitVector) & (bit))
|
||||
|
||||
#endif // COMMONMACROS_H
|
||||
|
@ -10,12 +10,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include "archtypes.h"
|
||||
|
||||
extern uint32 crc32c_t8_nosse(uint32 iCRC, uint8 u8);
|
||||
extern uint32 crc32c_t8_sse(uint32 iCRC, uint8 u8);
|
||||
*/
|
||||
#pragma once
|
||||
#include "archtypes.h"
|
||||
|
||||
extern uint32 crc32c_t8_nosse(uint32 iCRC, uint8 u8);
|
||||
extern uint32 crc32c_t8_sse(uint32 iCRC, uint8 u8);
|
||||
extern uint32 crc32c_t_nosse(uint32 iCRC, const uint8 *buf, int len);
|
||||
extern uint32 crc32c_t_sse(uint32 iCRC, const uint8 *buf, unsigned int len);
|
||||
extern uint32 crc32c_t(uint32 iCRC, const uint8 *buf, unsigned int len);
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
|
||||
// Specifies priorities for hooks call order in the chain.
|
||||
// For equal priorities first registered hook will be called first.
|
||||
enum HookChainPriority : int
|
||||
enum HookChainPriority
|
||||
{
|
||||
HC_PRIORITY_UNINTERRUPTABLE = 255, // Hook will be called before other hooks.
|
||||
HC_PRIORITY_HIGH = 192, // Hook will be called before hooks with default priority.
|
||||
|
@ -292,6 +292,7 @@ typedef struct aliashdr_s
|
||||
|
||||
typedef enum modtype_e
|
||||
{
|
||||
mod_bad = -1,
|
||||
mod_brush,
|
||||
mod_sprite,
|
||||
mod_alias,
|
||||
|
@ -103,6 +103,7 @@
|
||||
#define HIDDEN
|
||||
#define NOINLINE __declspec(noinline)
|
||||
#define ALIGN16 __declspec(align(16))
|
||||
#define NORETURN __declspec(noreturn)
|
||||
#define FORCE_STACK_ALIGN
|
||||
|
||||
//inline bool SOCKET_FIONBIO(SOCKET s, int m) { return (ioctlsocket(s, FIONBIO, (u_long*)&m) == 0); }
|
||||
@ -148,6 +149,7 @@
|
||||
#define HIDDEN __attribute__((visibility("hidden")))
|
||||
#define NOINLINE __attribute__((noinline))
|
||||
#define ALIGN16 __attribute__((aligned(16)))
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#define FORCE_STACK_ALIGN __attribute__((force_align_arg_pointer))
|
||||
|
||||
//inline bool SOCKET_FIONBIO(SOCKET s, int m) { return (ioctl(s, FIONBIO, (int*)&m) == 0); }
|
||||
|
@ -310,10 +310,13 @@ typedef struct
|
||||
} mstudiotrivert_t;
|
||||
#endif
|
||||
|
||||
#define STUDIO_DYNAMIC_LIGHT 0x0100 // dynamically get lighting from floor or ceil (flying monsters)
|
||||
#define STUDIO_TRACE_HITBOX 0x0200 // always use hitbox trace instead of bbox
|
||||
|
||||
// lighting options
|
||||
#define STUDIO_NF_FLATSHADE 0x0001
|
||||
#define STUDIO_NF_CHROME 0x0002
|
||||
#define STUDIO_NF_FULLBRIGHT 0x0004
|
||||
#define STUDIO_NF_FULLBRIGHT 0x0004
|
||||
#define STUDIO_NF_NOMIPS 0x0008
|
||||
#define STUDIO_NF_ALPHA 0x0010
|
||||
#define STUDIO_NF_ADDITIVE 0x0020
|
||||
@ -321,7 +324,7 @@ typedef struct
|
||||
|
||||
// motion flags
|
||||
#define STUDIO_X 0x0001
|
||||
#define STUDIO_Y 0x0002
|
||||
#define STUDIO_Y 0x0002
|
||||
#define STUDIO_Z 0x0004
|
||||
#define STUDIO_XR 0x0008
|
||||
#define STUDIO_YR 0x0010
|
||||
|
@ -198,7 +198,7 @@ void CSimplePlatform::SteamAPI_UnregisterCallback(CCallbackBase *pCallback)
|
||||
::SteamAPI_UnregisterCallback(pCallback);
|
||||
}
|
||||
|
||||
void __declspec(noreturn) rehlds_syserror(const char* fmt, ...) {
|
||||
void NORETURN rehlds_syserror(const char* fmt, ...) {
|
||||
va_list argptr;
|
||||
static char string[8192];
|
||||
|
||||
|
@ -122,4 +122,4 @@ public:
|
||||
static void set(IReHLDSPlatform* p);
|
||||
};
|
||||
|
||||
extern void __declspec(noreturn) rehlds_syserror(const char* fmt, ...);
|
||||
extern void NORETURN rehlds_syserror(const char* fmt, ...);
|
||||
|
Loading…
Reference in New Issue
Block a user