12.01.2017, 14:11
Quote:
How is it considered as 'better' lol, I truly don't see how, as it's different for everyone.
Having "new bool:Something = false;" is just for the sight of your eyes, and yes, I know a boolean is FALSE by default, but as I've said, it's just for the sight. I do not see how it is possibly considered as better. |
Quote:
Originally Posted by Michael Shimmins
The first example nearly always wins in my book:
if(foo) { } It's shorter and more concise. Why add an extra check to something when it's absolutely not needed? Just wasting cycles... I do agree, though, that sometimes the more verbose syntax makes things more readable (which is ultimately more important as long as performance is acceptable) in situations where variables are poorly named. |
-----
Quote:
About IsPlayerDead : By considering what you said, it can fail sometimes. OnPlayerSpawn can be bypassed, though it's the responsibility of the server developer. But there are exceptional cases where you get spawned without OnPlayerSpawn getting called, so I'd recommend to consider state too along with what SickAttack suggested.
OT : There's no need to check if both the players have no teams assigned. If one among them doesn't have a team then it's assured that both either has no team or are from different teams. Other than that, good tutorial. |
Getting desynced is honestly the only way it won't be called, are you referring to that?