Thread: bot_sounds.cpp
View Single Post
Re: bot_sounds.cpp
Old
  (#4)
Huntkillaz
Member
 
Huntkillaz's Avatar
 
Status: Offline
Posts: 594
Join Date: Mar 2004
Location: Middle Earth (New Zealand)
Default Re: bot_sounds.cpp - 31-05-2004

so the bot_sounds.cpp can be reduced file size alot by adding a method similar to this:

Code:
  void SoundMethod(boolean a,float b, float c, boolean d)
   {
   	  if(a){
   		  if ((iIndex < 0) || (iIndex >= gpGlobals->maxClients))
 			 iIndex = UTIL_GetNearestPlayerIndex (VecBModelOrigin (pEdict));
   	  }
   		 clients[iIndex].fHearingDistance = b * fVolume;
   		 clients[iIndex].fTimeSoundLasting = gpGlobals->time + c;
   		if(d)
 			 clients[iIndex].vecSoundPosition = pEdict->v.origin;
   		  else
   			  clients[iIndex].vecSoundPosition = vecPosition;
   }
and having 1 method call at each place instead of 3-5 lines?

but will it be efficient??


●_•

Last edited by Huntkillaz; 31-05-2004 at 05:12..
  
Reply With Quote