I've looked to this and solved 2 problems using a small trick
- Fixed the explosion clipping problem
- Fixed the shots not registering on 2 out of four walls
2 changes need to be made in CWeapon.cpp and are marked by //Added by Nout in the code-segment below
Code: Select all
/* 07/15/2004 Wendell Buckner
BUG FIX - Bone Collisions fail because we expect to hit the bone immediately after hitting the
overall bounding box. So tag the actor as being hit at the bounding box level and after that check ONLY
the bone bounding boxes until the whatever hit the overall bounding box no longer exists.
//if(CCD->Collision()->CheckForCollisionD(&d->ExtBox.Min, &d->ExtBox.Max,
if(CCD->Collision()->CheckForBoneCollision(&d->ExtBox.Min, &d->ExtBox.Max,tempPos, tempPos1, &Collision, d->Actor, BoneHit, d->BoneLevel)) */
if(CCD->Collision()->CheckForBoneCollision(&d->ExtBox.Min, &d->ExtBox.Max, tempPos, tempPos1, &Collision, d->Actor, BoneHit, d->BoneLevel, d ))
{
//
// Handle collision here
//
int nHitType = CCD->Collision()->ProcessCollision(Collision, d->Actor, false);
if(nHitType != kNoCollision)
{
Alive = false;
d->Pos = Collision.Impact;
//Added by Nout
geVec3d_Scale(&d->Pos, 0.99f, &d->Pos);
//End added by Nout
Actor = Collision.Actor;
Model = Collision.Model;
if(nHitType == kCollideNoMove)
{
geVec3d_AddScaled (&tempPos, &(d->Direction), 1000.0f, &tempPos1);
CCD->Collision()->CheckForWCollision(NULL, NULL,
tempPos, tempPos1, &Collision, d->Actor);
CCD->Decals()->AddDecal(d->Decal, &Collision.Impact, &Collision.Plane.Normal);
}
}
}
}
// Move and Pose
if(Alive)
{
d->Pos = tempPos1;
//Added by Nout
geVec3d_Scale(&d->Pos, 0.99f, &d->Pos);
//End added by Nout
CCD->ActorManager()->Position(d->Actor, d->Pos);
CCD->ActorManager()->GetBoundingBox(d->Actor, &d->ExtBox);
if(d->MoveSoundEffect!=-1)
{
Snd Sound;
geVec3d_Copy( &(d->Pos), &( Sound.Pos ) );
CCD->EffectManager()->Item_Modify(EFF_SND, d->MoveSoundEffect, (void *)&Sound, SND_POS);
}
and further....
This update will be part of the next release