1

Topic: COLFLAG limit

Hi all

I just noticed that there's limit to collision flags.

e.g.

enum
{
    COLFLAG_SOLID=1,
    COLFLAG_DEATH=2,
    COLFLAG_NOHOOK=4,
    COLFLAG_TEST1=8,
    COLFLAG_TEST2=16,
    COLFLAG_TEST3=32,
    COLFLAG_TEST4=64,
    COLFLAG_TEST5=128,
    COLFLAG_TEST6=256,
    COLFLAG_TEST7=512
};

so GameServer()->Collision()->GetCollisionAt(Pos.x, Pos.y)&CCollision::COLFLAG_TEST6) doesn't work. test 1, 2, 3, 4 & 5 works fine, but are flags 256 & 512 too big for... something?

Am I missing something, or is there a way around?

2

Re: COLFLAG limit

haven't looked into the source for a while but im pretty sure the variable containing the flags is a char (therefore 1 byte long).

flags are divided in bits. each bit represents one flag. 1 byte holds 8 bit, so you can use 8 flags.

3

Re: COLFLAG limit

Hi,

looked into the source.

Shadd!X is right... it's an unsigned char. therefore max 8 flags.

class CTile
{
public:
    unsigned char m_Index;
    unsigned char m_Flags;
    unsigned char m_Skip;
    unsigned char m_Reserved;
};

Greetings Piko

#yemDX is a known troll

4

Re: COLFLAG limit

Thanks to you both! Suspected something of a sort.

/Siile