garrysmod
garrysmod copied to clipboard
Simplified tobool
imo you just made it confusing
return !( val == nil || val == false || val == 0 || val == "0" || val == "false" )
or
return val != nil && val != false && val != 0 && val != "0" && val != "false"
anything else makes little sense
It's better to get rid of C keywords.
bruh

bruh
If I omit the "not not", it will return nil if it's given a nil instead of false, so not not has to be there. No bruh.
Use @neico's second solution, it's the easiest to read.
Use @neico's second solution, it's the easiest to read.
Imagine using C operators in GMod in 2020... Why would you?
Hello, As I feel like we will not agree on what to do, I decided to compile it to Lua 5.1 bytecode. You can now load the bytecode using this interpreter :
https://raw.githubusercontent.com/Rerumu/Rerubi/master/Source.lua bytecode.out
@mastopgunaf Because it's the accepted style of the codebase at the moment. We can evaluate changing it all in the future, but for now, stick with the common style or this won't be accepted.
@mastopgunaf Because it's the accepted style of the codebase at the moment. We can evaluate changing it all in the future, but for now, stick with the common style or this won't be accepted.
I changed it to those terrible operators, should be ok now.
The double ! is still unreadable, but whatever I guess.
What is this meant to achieve?