Change magic numbers of BSP version checks to macro defines.
This commit is contained in:
parent
46fb7c2e26
commit
6583a42a87
14 changed files with 19 additions and 19 deletions
|
@ -33,7 +33,7 @@ Player_PreDraw(base_player pl, int thirdperson)
|
|||
makevectors(ang);
|
||||
traceline(src, src + (v_forward * 8096), MOVE_NORMAL, pl);
|
||||
|
||||
if (serverkeyfloat("*bspversion") == 30) {
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
|
||||
dynamiclight_add(trace_endpos + (v_forward * -2), 128, [1,1,1]);
|
||||
} else {
|
||||
float p = dynamiclight_add(src, 512, [1,1,1], 0, "textures/flashlight");
|
||||
|
|
|
@ -904,7 +904,7 @@ void
|
|||
CSQC_WorldLoaded(void)
|
||||
{
|
||||
/* Primarily for the flashlight */
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
|
||||
localcmd("r_shadow_realtime_dlight 1\n");
|
||||
} else {
|
||||
localcmd("r_shadow_realtime_dlight 0\n");
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
void
|
||||
Sky_Update(void)
|
||||
{
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
|
||||
return;
|
||||
}
|
||||
localcmd(sprintf("sky %s\n", g_strSkyName));
|
||||
|
|
|
@ -33,7 +33,7 @@ Player_PreDraw(base_player pl, int thirdperson)
|
|||
makevectors(ang);
|
||||
traceline(src, src + (v_forward * 8096), MOVE_NORMAL, pl);
|
||||
|
||||
if (serverkeyfloat("*bspversion") == 30) {
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
|
||||
dynamiclight_add(trace_endpos + (v_forward * -2), 128, [1,1,1]);
|
||||
} else {
|
||||
float p = dynamiclight_add(src, 512, [1,1,1], 0, "textures/flashlight");
|
||||
|
|
|
@ -170,7 +170,7 @@ env_sound::env_sound(void)
|
|||
setorigin(this, origin);
|
||||
|
||||
/* Valve BSP, convert their env_sound */
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ This entity was introduced in Half-Life 2 (2004).
|
|||
int
|
||||
Util_IsSky(vector pos)
|
||||
{
|
||||
if (serverkeyfloat("*bspversion") == 30)
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL)
|
||||
if (getsurfacetexture(world, getsurfacenearpoint(world, pos)) == "sky") {
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ func_breakable::Pain(void)
|
|||
if (spawnflags & SF_TRIGGER) {
|
||||
return;
|
||||
}
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ infodecal::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
infodecal::infodecal(void)
|
||||
{
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
|
||||
remove(self);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ decal::ReceiveEntity(void)
|
|||
|
||||
size = drawgetimagesize(m_strTexture);
|
||||
|
||||
if (serverkeyfloat("*bspversion") == 30) {
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
|
||||
BuildShader();
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ decal::Place(vector org, string dname)
|
|||
#else
|
||||
size = drawgetimagesize(m_strTexture);
|
||||
|
||||
if (serverkeyfloat("*bspversion") == 30) {
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
|
||||
BuildShader();
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ decal Decals_Next(vector pos)
|
|||
/* Generalized Decal Placing Function */
|
||||
void Decals_Place(vector pos, string dname)
|
||||
{
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ void initents(void)
|
|||
/* sound shader init */
|
||||
Sound_Init();
|
||||
|
||||
if (serverkeyfloat("*bspversion") != 30) {
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
|
||||
/* load materials.txt because someone thought this was the best idea */
|
||||
filestream fileMaterial = fopen("sound/materials.txt", FILE_READ);
|
||||
hashMaterials = __NULL__;
|
||||
|
|
|
@ -267,12 +267,12 @@ Footsteps_Update(void)
|
|||
pl.step_time = time + 0.35;
|
||||
|
||||
switch (serverkeyfloat("*bspversion")) {
|
||||
case 30: /* HL */
|
||||
case BSPVER_HL:
|
||||
Footsteps_HLBSP(pl);
|
||||
break;
|
||||
case 46: /* Q3 */
|
||||
case 47: /* RtCW */
|
||||
case 1: /* RFVBSP */
|
||||
case BSPVER_Q3: /* Q3 */
|
||||
case BSPVER_RTCW: /* RtCW */
|
||||
case BSPVER_RBSP: /* RFVBSP */
|
||||
Footsteps_VVBSP(pl);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -45,7 +45,7 @@ FX_Blood(vector pos, vector color)
|
|||
#else
|
||||
static void Blood_Touch(void)
|
||||
{
|
||||
if (serverkeyfloat("*bspversion") == 30)
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL)
|
||||
Decals_Place(self.origin, sprintf("{blood%d", floor(random(1,9))));
|
||||
else {
|
||||
decal_pickwall(self, self.origin);
|
||||
|
|
|
@ -52,7 +52,7 @@ FX_GibHuman(vector pos)
|
|||
}
|
||||
static void Gib_Touch(void)
|
||||
{
|
||||
if (serverkeyfloat("*bspversion") == 30)
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL)
|
||||
Decals_Place(self.origin, sprintf("{blood%d", floor(random(1,9))));
|
||||
else {
|
||||
decal_pickwall(self, self.origin);
|
||||
|
|
|
@ -88,7 +88,7 @@ FX_Impact(int iType, vector vecPos, vector vNormal)
|
|||
multicast(vecPos, MULTICAST_PVS);
|
||||
#else
|
||||
/* decals */
|
||||
if (serverkeyfloat("*bspversion") == 30)
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL)
|
||||
switch (iType) {
|
||||
case IMPACT_GLASS:
|
||||
Decals_Place(vecPos, sprintf("{break%d", floor(random(1,4))));
|
||||
|
|
Loading…
Reference in a new issue