2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-17 00:58:18 +03:00

Fixed: parameter constraint in PF_lightstyle_I

This commit is contained in:
Souvik Das 2017-02-15 00:32:54 +05:30
parent 6a9d611a25
commit 656c5d5f52
5 changed files with 8 additions and 7 deletions

View File

@ -1839,9 +1839,10 @@ void ParseSaveTables(SAVERESTOREDATA *pSaveData, SAVE_HEADER *pHeader, int updat
gEntityInterface.pfnSaveReadFields(pSaveData, "LIGHTSTYLE", &light, gLightstyleDescription, ARRAYSIZE(gLightstyleDescription));
if (updateGlobals)
{
g_psv.lightstyles[light.index] = (char *)Hunk_Alloc(Q_strlen(light.style) + 1);
Q_strncpy(g_psv.lightstyles[light.index], light.style, 3);
g_psv.lightstyles[light.index][3] = 0;
char *val = (char *)Hunk_Alloc(Q_strlen(light.style) + 1);
Q_strncpy(val, light.style, 3);
val[3] = 0;
g_psv.lightstyles[light.index] = val;
}
}
}

View File

@ -1710,7 +1710,7 @@ int EXT_FUNC PF_DecalIndex(const char *name)
return -1;
}
void EXT_FUNC PF_lightstyle_I(int style, char *val)
void EXT_FUNC PF_lightstyle_I(int style, const char *val)
{
g_psv.lightstyles[style] = val;
if (g_psv.state != ss_active)

View File

@ -161,7 +161,7 @@ void PF_SetClientKeyValue_I(int clientIndex, char *infobuffer, const char *key,
int PF_walkmove_I(edict_t *ent, float yaw, float dist, int iMode);
int PF_droptofloor_I(edict_t *ent);
int PF_DecalIndex(const char *name);
void PF_lightstyle_I(int style, char *val);
void PF_lightstyle_I(int style, const char *val);
int PF_checkbottom_I(edict_t *pEdict);
int PF_pointcontents_I(const float *rgflVector);
void PF_aim_I(edict_t *ent, float speed, float *rgflReturn);

View File

@ -129,7 +129,7 @@ typedef struct server_s
const char *generic_precache[MAX_GENERIC];
char generic_precache_names[MAX_GENERIC][64];
int num_generic_names;
char *lightstyles[MAX_LIGHTSTYLES];
const char *lightstyles[MAX_LIGHTSTYLES];
int num_edicts;
int max_edicts;
edict_t *edicts;

View File

@ -148,7 +148,7 @@ typedef struct enginefuncs_s
void (*pfnServerExecute) (void);
void (*pfnClientCommand) (edict_t* pEdict, const char* szFmt, ...);
void (*pfnParticleEffect) (const float *org, const float *dir, float color, float count);
void (*pfnLightStyle) (int style, char* val);
void (*pfnLightStyle) (int style, const char* val);
int (*pfnDecalIndex) (const char *name);
int (*pfnPointContents) (const float *rgflVector);
void (*pfnMessageBegin) (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);