Make testgun command without argument disable test gun model

This commit is contained in:
Zack Middleton 2018-06-24 22:18:12 -05:00
parent fb4b206709
commit 809a7765b2

View file

@ -71,6 +71,7 @@ can then be moved around
void CG_TestModel_f (void) { void CG_TestModel_f (void) {
vec3_t angles; vec3_t angles;
cg.testGun = qfalse;
memset( &cg.testModelEntity, 0, sizeof(cg.testModelEntity) ); memset( &cg.testModelEntity, 0, sizeof(cg.testModelEntity) );
if ( trap_Argc() < 2 ) { if ( trap_Argc() < 2 ) {
return; return;
@ -96,7 +97,6 @@ void CG_TestModel_f (void) {
angles[ROLL] = 0; angles[ROLL] = 0;
AnglesToAxis( angles, cg.testModelEntity.axis ); AnglesToAxis( angles, cg.testModelEntity.axis );
cg.testGun = qfalse;
} }
/* /*
@ -108,6 +108,11 @@ Replaces the current view weapon with the given model
*/ */
void CG_TestGun_f (void) { void CG_TestGun_f (void) {
CG_TestModel_f(); CG_TestModel_f();
if ( !cg.testModelEntity.hModel ) {
return;
}
cg.testGun = qtrue; cg.testGun = qtrue;
cg.testModelEntity.renderfx = RF_MINLIGHT | RF_DEPTHHACK | RF_FIRST_PERSON; cg.testModelEntity.renderfx = RF_MINLIGHT | RF_DEPTHHACK | RF_FIRST_PERSON;
} }