I definately believe that a good compiler would and should not even translate it, but it's still bad programming practice.
On 7/9/05, Tony Paloma <[EMAIL PROTECTED]> wrote: > Actually, just as a little side note, it seems as long as there is no > function in the expression, no machine code gets added to the program when > an if's statement has no code. So.... > > if ( gpGlobals->maxClients > 1 ) > { > //return; > } > > ..adds no real code and no cycles get added. I checked this using MSVC++ 6 > and I'm assuming it works the same for .NET. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of <SB> Childe > Roland > Sent: Friday, July 08, 2005 3:27 PM > To: hlcoders@list.valvesoftware.com > Subject: Re: [hlcoders] Third Person Camera Tutorial > > Why wouldn't you comment out the entire "if" statement?? Do you like > wasting processor cycles? > > On 7/3/05, Kamran <[EMAIL PROTECTED]> wrote: > > [ Converted text/html to text/plain ] > > That's because of this function: > > /* > > ============================== > > CAM_ToThirdPerson > > ============================== > > */ > > void CInput::CAM_ToThirdPerson(void) > > { > > QAngle viewangles; > > // Do allow third person in TF2 for now > > #if !defined( TF2_CLIENT_DLL ) && !defined( CSTRIKE_DLL ) > > #if !defined( _DEBUG ) > > if ( gpGlobals->maxClients > 1 ) > > { > > // no thirdperson in multiplayer. > > return; > > } > > #endif > > #endif > > engine->GetViewAngles( viewangles ); > > if( !m_fCameraInThirdPerson ) > > { > > m_fCameraInThirdPerson = true; > > > > m_vecCameraOffset[ YAW ] = viewangles[ YAW ]; > > m_vecCameraOffset[ PITCH ] = viewangles[ PITCH ]; > > m_vecCameraOffset[ 2 ] = CAM_SWITCH_DIST; > > // Set model to player because when a map first loads > > // it doesn't set the model... sort of a hack. > > C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer(); > > pPlayer->SetModel("player"); > > } > > cam_command.SetValue( 0 ); > > } > > Just comment out the "return;" under "No third person in multiplayer". > > Draco wrote: > > > > Thank you, I was looking into getting a thirdperson camera working, > > but I couldn't go thridperson in multiplayer and using release dlls, I > > could never find why. > > > > > > -- > > Draco > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders[1] > > > > > > > > > > > > -- > > Kamran A > > Get Firefox! Safer, Faster, Better.[2] > > Down with Internet Explorer! Say "NO!" to Spyware! Use Firefox > > > > ===References:=== > > 1. http://list.valvesoftware.com/mailman/listinfo/hlcoders > > 2. http://www.spreadfirefox.com/?q=affiliates&id=0&t=85 > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > -- > ============================= > <SB> Childe Roland > "I will show you fear in a handful of jellybeans." > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, please > visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > -- ============================= <SB> Childe Roland "I will show you fear in a handful of jellybeans." _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders