infodecal: Allow usage outside of HL BSP. Just not Quake 1/2 BSP.

This commit is contained in:
Marco Cawthorne 2022-04-04 21:34:00 -07:00
parent 542b1fe27f
commit 0a75c64fb1
Signed by: eukara
GPG key ID: C196CD8BA993248A
3 changed files with 29 additions and 7 deletions

View file

@ -116,6 +116,8 @@ infodecal::SpawnKey(string strKey, string strValue)
{
switch (strKey) {
case "material":
m_strTexture = strValue;
break;
case "texture":
m_strTexture = strtolower(strValue);
break;
@ -127,7 +129,15 @@ infodecal::SpawnKey(string strKey, string strValue)
void
infodecal::infodecal(void)
{
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
float bsp_version = serverkeyfloat("*bspversion");
switch (bsp_version) {
case BSPVER_HL:
case BSPVER_RBSP:
case BSPVER_Q3:
case BSPVER_RTCW:
break;
default:
remove(self);
return;
}

View file

@ -176,21 +176,18 @@ void
NSEntity::Touch(entity eToucher)
{
/* To be handled by sub-classes */
print("touched!\n");
}
void
NSEntity::StartTouch(entity eToucher)
{
/* To be handled by sub-classes */
print("start touched!\n");
}
void
NSEntity::EndTouch(entity eToucher)
{
/* To be handled by sub-classes */
print("end touched!\n");
}
void

View file

@ -94,6 +94,8 @@ decal::ReceiveEntity(void)
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
BuildShader();
} else {
m_strShader = m_strTexture;
}
makevectors(angles);
@ -152,11 +154,14 @@ decal::BuildShader(void)
void
decal::Place(vector org, string dname)
{
if (!dname)
return;
decal_pickwall(this, org);
/* we never hit any wall. */
if (g_tracedDecal.fraction == 1.0f) {
dprint(sprintf("^1infodecal tracing failed at %v\n", org));
print(sprintf("^1infodecal tracing failed at %v\n", org));
if (classname != "tempdecal")
remove(this);
return;
@ -190,6 +195,8 @@ decal::Place(vector org, string dname)
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
BuildShader();
} else {
m_strShader = m_strTexture;
}
makevectors(angles);
@ -252,8 +259,16 @@ decal Decals_Next(vector pos)
/* Generalized Decal Placing Function */
void Decals_Place(vector pos, string dname)
{
if (serverkeyfloat("*bspversion") != BSPVER_HL) {
return;
float bsp_version = serverkeyfloat("*bspversion");
switch (bsp_version) {
case BSPVER_HL:
case BSPVER_RBSP:
case BSPVER_Q3:
case BSPVER_RTCW:
break;
default:
return;
}
decal x = Decals_Next(pos);