Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
but for some reason, this is not working. I was googling it a bit, and realized that the bitflags are defined differently in C/C++ and wanted to get an opinion from people who've worked with the source to see if the way I'm doing it wrong.
Whenever I try to turn off flags or toggle them, this doesnt seem to work. However, checking flags that are active does seem to apply correctly. That is, unless the checks just aren't working correctly.
If more code if needed, I can post it. I'm just working on an old module and don't have enough of it separated to provide a good working example at the moment.
Graf Zahl wrote:Of course more code is needed. Who knows what you did wrong without posting anything checkable at all...?
I get that, I'm more asking about it in general. As in, how are you SUPPOSED to be doing it in doom? I've read something close to 3 different ways of doing it. However, making a mockup example of what I was doing seems to be working on the single flag level, but combining flags doesnt seem to work.
Also thank you for the quick response Graf
In the process of making my example, I think I see what I've been doing wrong. So I need to rephrase my question
How do I check multiple bitflags within a single statement?
if (bitflags & flag1|flag2) //if flags 1 and 2 are active
{
//do stuff
}
But this clearly doesnt work, as it is expecting the value to just be non-zero. Judging from my working example, how are multiple flags supposed be checked? One at a time? Or can I combine them to check multiple values at once?
Working example code below, puke respective scripts for basic results. Wad provided in drop box link.