mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-30 16:00:55 +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$
|
// $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
|
// Revision 1.34 2002/05/02 02:28:36 blaze
|
||||||
// Triggerable and targetable breakables
|
// Triggerable and targetable breakables
|
||||||
//
|
//
|
||||||
|
@ -525,7 +528,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
{
|
{
|
||||||
health = 5;
|
health = 5;
|
||||||
}
|
}
|
||||||
G_Printf("Setting health to %d\n",health);
|
//G_Printf("Setting health to %d\n",health);
|
||||||
G_SpawnInt("damage","170", &damage);
|
G_SpawnInt("damage","170", &damage);
|
||||||
|
|
||||||
ent->damage = damage;
|
ent->damage = damage;
|
||||||
|
@ -537,7 +540,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
ent->exploded = qfalse;
|
ent->exploded = qfalse;
|
||||||
// Setup amount type
|
// Setup amount type
|
||||||
G_SpawnInt( "amount", "0", &temp );
|
G_SpawnInt( "amount", "0", &temp );
|
||||||
|
//Com_Printf("Amount %d ", temp);
|
||||||
switch (temp)
|
switch (temp)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -559,6 +562,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
if ( ent->spawnflags & 1)
|
if ( ent->spawnflags & 1)
|
||||||
{
|
{
|
||||||
ent->chippable = qtrue;
|
ent->chippable = qtrue;
|
||||||
|
//Com_Printf("Chippable ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -568,6 +572,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
if ( ent->spawnflags & 2)
|
if ( ent->spawnflags & 2)
|
||||||
{
|
{
|
||||||
ent->unbreakable = qtrue;
|
ent->unbreakable = qtrue;
|
||||||
|
//Com_Printf("Unbreakable ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -577,6 +582,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
if ( ent->spawnflags & 4)
|
if ( ent->spawnflags & 4)
|
||||||
{
|
{
|
||||||
ent->explosive = qtrue;
|
ent->explosive = qtrue;
|
||||||
|
//Com_Printf("Explosive ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -596,6 +602,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
G_FreeEntity( ent );
|
G_FreeEntity( ent );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//Com_Printf("ID (%d) ", id);
|
||||||
if (G_SpawnString( "type", "", &name) )
|
if (G_SpawnString( "type", "", &name) )
|
||||||
{
|
{
|
||||||
Q_strncpyz(rq3_breakables[id],name,80);
|
Q_strncpyz(rq3_breakables[id],name,80);
|
||||||
|
@ -606,6 +613,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
G_FreeEntity( ent );
|
G_FreeEntity( ent );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//Com_Printf("type (%s)\n",name);
|
||||||
|
|
||||||
amount = amount << 6;
|
amount = amount << 6;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.49 2002/04/29 06:16:10 niceass
|
||||||
// small change to pressure system
|
// small change to pressure system
|
||||||
//
|
//
|
||||||
|
@ -1645,6 +1648,23 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
traceEnt = &g_entities[ trace.entityNum ];
|
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
|
// NiceAss: Special hit-detection stuff for the head
|
||||||
if ( traceEnt->takedamage && traceEnt->client && G_HitPlayer(traceEnt, forward, trace.endpos) == qfalse ) {
|
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
|
//Breakables may have broken already already
|
||||||
if (hitBreakable == qfalse)
|
if (hitBreakable == qfalse)
|
||||||
{
|
{
|
||||||
G_Printf("Unlinking Something\n");
|
|
||||||
trap_UnlinkEntity( traceEnt );
|
trap_UnlinkEntity( traceEnt );
|
||||||
unlinkedEntities[unlinked] = traceEnt;
|
unlinkedEntities[unlinked] = traceEnt;
|
||||||
unlinked++;
|
unlinked++;
|
||||||
|
|
Loading…
Reference in a new issue