mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-11 15:52:30 +00:00
Fixed breakables crashing on vashes
This commit is contained in:
parent
ab9ac90993
commit
bde6365877
2 changed files with 30 additions and 3 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.35 2002/05/02 03:06:09 blaze
|
||||
// Fixed breakables crashing on vashes
|
||||
//
|
||||
// Revision 1.34 2002/05/02 02:28:36 blaze
|
||||
// Triggerable and targetable breakables
|
||||
//
|
||||
|
@ -525,7 +528,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
{
|
||||
health = 5;
|
||||
}
|
||||
G_Printf("Setting health to %d\n",health);
|
||||
//G_Printf("Setting health to %d\n",health);
|
||||
G_SpawnInt("damage","170", &damage);
|
||||
|
||||
ent->damage = damage;
|
||||
|
@ -537,7 +540,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
ent->exploded = qfalse;
|
||||
// Setup amount type
|
||||
G_SpawnInt( "amount", "0", &temp );
|
||||
|
||||
//Com_Printf("Amount %d ", temp);
|
||||
switch (temp)
|
||||
{
|
||||
case 0:
|
||||
|
@ -559,6 +562,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
if ( ent->spawnflags & 1)
|
||||
{
|
||||
ent->chippable = qtrue;
|
||||
//Com_Printf("Chippable ");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -568,6 +572,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
if ( ent->spawnflags & 2)
|
||||
{
|
||||
ent->unbreakable = qtrue;
|
||||
//Com_Printf("Unbreakable ");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -577,6 +582,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
if ( ent->spawnflags & 4)
|
||||
{
|
||||
ent->explosive = qtrue;
|
||||
//Com_Printf("Explosive ");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -596,6 +602,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
G_FreeEntity( ent );
|
||||
return;
|
||||
}
|
||||
//Com_Printf("ID (%d) ", id);
|
||||
if (G_SpawnString( "type", "", &name) )
|
||||
{
|
||||
Q_strncpyz(rq3_breakables[id],name,80);
|
||||
|
@ -606,6 +613,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
G_FreeEntity( ent );
|
||||
return;
|
||||
}
|
||||
//Com_Printf("type (%s)\n",name);
|
||||
|
||||
amount = amount << 6;
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.50 2002/05/02 03:06:09 blaze
|
||||
// Fixed breakables crashing on vashes
|
||||
//
|
||||
// Revision 1.49 2002/04/29 06:16:10 niceass
|
||||
// small change to pressure system
|
||||
//
|
||||
|
@ -1645,6 +1648,23 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
|
|||
}
|
||||
|
||||
traceEnt = &g_entities[ trace.entityNum ];
|
||||
if ( traceEnt->unbreakable == qtrue)
|
||||
{
|
||||
Material = GetMaterialFromFlag(trace.surfaceFlags);
|
||||
//if ( (trace.surfaceFlags & SURF_METALSTEPS) ||
|
||||
// (trace.surfaceFlags & SURF_METAL2) )
|
||||
if ( IsMetalMat(Material) )
|
||||
tent[unlinked] = G_TempEntity( trace.endpos, EV_BULLET_HIT_METAL );
|
||||
else if (Material == MAT_GLASS)
|
||||
tent[unlinked] = G_TempEntity( trace.endpos, EV_BULLET_HIT_GLASS );
|
||||
else
|
||||
tent[unlinked] = G_TempEntity( trace.endpos, EV_BULLET_HIT_WALL );
|
||||
|
||||
if ( traceEnt && traceEnt->s.eType == ET_PRESSURE )
|
||||
G_CreatePressure(trace.endpos, trace.plane.normal, traceEnt);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// NiceAss: Special hit-detection stuff for the head
|
||||
if ( traceEnt->takedamage && traceEnt->client && G_HitPlayer(traceEnt, forward, trace.endpos) == qfalse ) {
|
||||
|
@ -1734,7 +1754,6 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
|
|||
//Breakables may have broken already already
|
||||
if (hitBreakable == qfalse)
|
||||
{
|
||||
G_Printf("Unlinking Something\n");
|
||||
trap_UnlinkEntity( traceEnt );
|
||||
unlinkedEntities[unlinked] = traceEnt;
|
||||
unlinked++;
|
||||
|
|
Loading…
Reference in a new issue