8000 Make testgun command without argument disable test gun model · Turtle-Arena/turtle-arena-code@6865a12 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6865a12

Browse files
committed
Make testgun command without argument disable test gun model
1 parent 74cffed commit 6865a12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

code/cgame/cg_view.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ can then be moved around
7979
void CG_TestModel_f (void) {
8080
vec3_t angles;
8181

82+
cg.testGun = qfalse;
8283
memset( &cg.testModelEntity, 0, sizeof(cg.testModelEntity) );
8384
if ( trap_Argc() < 2 ) {
8485
return;
@@ -104,7 +105,6 @@ void CG_TestModel_f (void) {
104105
angles[ROLL] = 0;
105106

106107
AnglesToAxis( angles, cg.testModelEntity.axis );
107-
cg.testGun = qfalse;
108108
}
109109

110110
/*
@@ -127,6 +127,11 @@ Replaces the current view weapon with the given model
127127
*/
128128
void CG_TestGun_f (void) {
129129
CG_TestModel_f();
130+
131+
if ( !cg.testModelEntity.hModel ) {
132+
return;
133+
}
134+
130135
cg.testGun = qtrue;
131136
cg.testModelEntity.renderfx = RF_DEPTHHACK | RF_NO_MIRROR;
132137
}

0 commit comments

Comments
 (0)
0