Index: code/renderer/tr_model.c =================================================================== --- code/renderer/tr_model.c (revision 1951) +++ code/renderer/tr_model.c (working copy) @@ -1121,28 +1121,44 @@ */ void R_ModelBounds( qhandle_t handle, vec3_t mins, vec3_t maxs ) { model_t *model; - md3Header_t *header; - md3Frame_t *frame; model = R_GetModelByHandle( handle ); - if ( model->bmodel ) { + if (model->type == MOD_BRUSH) { VectorCopy( model->bmodel->bounds[0], mins ); VectorCopy( model->bmodel->bounds[1], maxs ); - return; - } + } else if (model->type == MOD_MESH) { + md3Header_t *header; + md3Frame_t *frame; - if ( !model->md3[0] ) { + header = model->md3[0]; + frame = (md3Frame_t *) ((byte *)header + header->ofsFrames); + + VectorCopy( frame->bounds[0], mins ); + VectorCopy( frame->bounds[1], maxs ); + } else if (model->type == MOD_MD4) { + md4Header_t *header; + md4Frame_t *frame; + + header = (md4Header_t *)model->md4; + frame = (md4Frame_t *) ((byte *)header + header->ofsFrames); + + VectorCopy( frame->bounds[0], mins ); + VectorCopy( frame->bounds[1], maxs ); +#ifdef RAVENMD4 + } else if (model->type == MOD_MDR) { + mdrHeader_t *header; + mdrFrame_t *frame; + + header = (mdrHeader_t *)model->md4; + frame = (mdrFrame_t *) ((byte *)header + header->ofsFrames); + + VectorCopy( frame->bounds[0], mins ); + VectorCopy( frame->bounds[1], maxs ); +#endif + } else { VectorClear( mins ); VectorClear( maxs ); - return; } - - header = model->md3[0]; - - frame = (md3Frame_t *)( (byte *)header + header->ofsFrames ); - - VectorCopy( frame->bounds[0], mins ); - VectorCopy( frame->bounds[1], maxs ); }