Team Check Alternativo

Posts 1–10 of 10 · Page 1 of 1
Team Check Alternativo
Para quem nao quer ficar repitindo o Codigo na hora de definir o time, aqui esta o codigo:

Exemplo:
Code:
int CorESP = ( pPlayer->Team != pLocal->Team ? Cor1 : Cor2 );
Nao vou falar como que usa, pra quem e bom Entendedor Meia Palavra Basta. ( Como o Chaos Sempre diz ).
Isso n eh meia palavra, ta na cara para o que se usa --'
Tem como criar uma funcao, pra ficar mais simples ainda.
You could just do

Code:
if ( pPlayer->Team != pLocal->Team )
{

}
Quote Originally Posted by Flengo View Post
You could just do

Code:
if ( pPlayer->Team != pLocal->Team )
{

}
That's twice as much work, and this code (which I have been using for several months now, way before this guy posted it) is much, much simpler and efficient. Although, my method is just slightly different.
Quote Originally Posted by Shadow` View Post
That's twice as much work, and this code (which I have been using for several months now, way before this guy posted it) is much, much simpler and efficient. Although, my method is just slightly different.
No it isn't.

You're allocating more memory to copy something already stored in the game's memory. You're doing twice the work.

Code:
pPlayer->Team and pLocal->Team
are both already stored in memory. Why create another 32-Bit (4 Bytes) integer to store it again.
Quote Originally Posted by Flengo View Post


No it isn't.

You're allocating more memory to copy something already stored in the game's memory. You're doing twice the work.

Code:
pPlayer->Team and pLocal->Team
are both already stored in memory. Why create another 32-Bit (4 Bytes) integer to store it again.
The same goes for your version. You have to check if the player is on your team or is an enemy. Your method takes up more space in the code, and checks it twice. The method posted is sort of clunky as well, he could have easily just done this:

Code:
int CorESP;
pPlayer->Team != pLocal->Team ? CorESP = Red : CorESP = Blue;
The code above is more fitting than both.
Quote Originally Posted by Shadow` View Post
The same goes for your version. You have to check if the player is on your team or is an enemy. Your method takes up more space in the code, and checks it twice. The method posted is sort of clunky as well, he could have easily just done this:

Code:
int CorESP;
pPlayer->Team != pLocal->Team ? CorESP = Red : CorESP = Blue;
The code above is more fitting than both.
Oh this is for colors.

I thougut it was for getting the enemy only LOL.

But anyway, its still checking the same number of timer.

Your Method: Checks at a different location, which checks the class, allocates more memory.

Cooler Method: Checks in the class only, doesn't allocate more memory.
Quote Originally Posted by Flengo View Post


Oh this is for colors.

I thougut it was for getting the enemy only LOL.

But anyway, its still checking the same number of timer.

Your Method: Checks at a different location, which checks the class, allocates more memory.

Cooler Method: Checks in the class only, doesn't allocate more memory.
I guess I'm just hipster
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us