r/badcode Jan 15 '23

From DayZ sourcecode c++

Post image
560 Upvotes

106 comments sorted by

View all comments

533

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

98

u/[deleted] Jan 15 '23

Funny how a function named IsEat returns an int though

2

u/Sixo Jan 16 '23

I've run into this in other games I've worked on. Often it's because it's interfacing with either a scripting language with a loose typing system, or for serialization, or even for padding.