diff --git a/src/server/defs.h b/src/server/defs.h index 82e7b1cf..c571f41b 100644 --- a/src/server/defs.h +++ b/src/server/defs.h @@ -88,7 +88,6 @@ var bool autocvar_mp_flashlight = true; void FX_Impact(impactType_t, vector, vector); void FX_Explosion(vector); -void FX_GibHuman(vector vecOrigin, vector vecDir, float flForce); void TraceAttack_FireBullets(int, vector, int, vector, int); #ifdef BULLETPENETRATION diff --git a/src/shared/NSSurfacePropEntity.qc b/src/shared/NSSurfacePropEntity.qc index b65d98dc..45e0859c 100644 --- a/src/shared/NSSurfacePropEntity.qc +++ b/src/shared/NSSurfacePropEntity.qc @@ -625,11 +625,11 @@ NSSurfacePropEntity::SpawnKey(string strKey, string strValue) m_oldHealth = health; break; case "propdata": - SetPropData(strValue); + m_strPropData = ReadString(strValue); break; case "surfdata": case "materialdata": - SetSurfaceData(strValue); + m_strSurfData = ReadString(strValue); break; /* entityDef */ case "blood_color": @@ -695,12 +695,15 @@ void NSSurfacePropEntity::SetSurfaceData(string type) { m_strSurfData = type; + _SurfaceDataFinish(); } void NSSurfacePropEntity::SetPropData(string type) { m_strPropData = type; + _PropDataFinish(); } + void NSSurfacePropEntity::_SurfaceDataFinish(void) { diff --git a/src/shared/propdata.h b/src/shared/propdata.h index 71eb07df..9c59af10 100644 --- a/src/shared/propdata.h +++ b/src/shared/propdata.h @@ -134,6 +134,7 @@ void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int void BreakModel_Receive(void); #else void BreakModel_Spawn(vector pos, vector dir, vector spread, float speed, int count, string type); +void BreakModel_Entity(NSSurfacePropEntity target, vector dir, float speed); #endif /* necessary API functions */ diff --git a/src/shared/propdata.qc b/src/shared/propdata.qc index b2572073..1051f1ea 100644 --- a/src/shared/propdata.qc +++ b/src/shared/propdata.qc @@ -639,4 +639,32 @@ BreakModel_Spawn(vector smins, vector smaxs, vector dir, float speed, int count, WriteByte(MSG_MULTICAST, count); multicast((smins - smaxs), MULTICAST_PVS); } + +void +BreakModel_Entity(NSSurfacePropEntity target, vector dir, float speed) +{ + string type = Prop_GetInfo(target.m_iPropData, PROPINFO_BREAKMODEL); + int count = Prop_GetInfo(target.m_iPropData, PROPINFO_BREAKCOUNT); + int index = (int)hash_get(g_hashbreakmodel, type, -1); + vector pos = target.GetOrigin(); + + if not (index) + return; + + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_BREAKMODEL); + WriteByte(MSG_MULTICAST, index); + WriteCoord(MSG_MULTICAST, pos[0] + target.mins[0]); + WriteCoord(MSG_MULTICAST, pos[1] + target.mins[1]); + WriteCoord(MSG_MULTICAST, pos[2] + target.mins[2]); + WriteCoord(MSG_MULTICAST, pos[0] + target.maxs[0]); + WriteCoord(MSG_MULTICAST, pos[1] + target.maxs[1]); + WriteCoord(MSG_MULTICAST, pos[2] + target.maxs[2]); + WriteCoord(MSG_MULTICAST, dir[0]); + WriteCoord(MSG_MULTICAST, dir[1]); + WriteCoord(MSG_MULTICAST, dir[2]); + WriteFloat(MSG_MULTICAST, speed); + WriteByte(MSG_MULTICAST, count); + multicast(pos, MULTICAST_PVS); +} #endif \ No newline at end of file