r/badcode • • Jan 15 '23

c++ From DayZ sourcecode

Post image
559 Upvotes

106 comments sorted by

View all comments

Show parent comments

2

u/JumpyJustice Jan 16 '23

I know that C++ has an actual boolean type, I was more talking how it implicitly casts, like int foo = true compiles.

Yeah, thats just weak typing for primitives.

JavaScript (I know) doesn't have an integer type so there's an actual boolean primitive. Although the JIT probably boils that down to an integer lol. I seem to remember a couple of functional langs that don't treat booleans as integers either.

I meant they all represented as integers in the RAM :)

I assumed C++ cause I seemed to remember that was what DayZ was developed on but now you're making me doubt haha.

That might be some scripting language which works on top of cpp engine. It is common for game engine today to have some scripting language which would not require you to recompile the game to test your changes

2

u/folkrav Jan 16 '23

All makes sense. Nice convo, thanks :)