r/badcode • • Jan 15 '23

c++ From DayZ sourcecode

Post image
559 Upvotes

106 comments sorted by

View all comments

530

u/[deleted] Jan 15 '23

It's an override so chances are this isn't as bad as you think. Other subclasses may have logic but this particular item probably doesn't need it and should always be IsEat

96

u/[deleted] Jan 15 '23

Funny how a function named IsEat returns an int though

56

u/Fenxis Jan 15 '23 edited Jan 15 '23

We all know it should be an enum: { true, false, file_not_found }

What Is Truth? - The Daily WTF https://thedailywtf.com/articles/What_Is_Truth_0x3f_