#pragma once

#ifdef SVQC
bool autocvar_sv_doors_always_open;
#endif

const int DOOR_START_OPEN = BIT(0); // has same meaning in Q3: reverse position 1 and 2
const int DOOR_DONT_LINK = BIT(2);
const int SPAWNFLAGS_GOLD_KEY = BIT(3); // Quake 1 and QL compat, can only be used with func_door!
const int SPAWNFLAGS_SILVER_KEY = BIT(4); // Quake 1 and QL compat, can only be used with func_door!
const int DOOR_TOGGLE = BIT(5);

const int DOOR_NONSOLID = BIT(10);
const int DOOR_CRUSH = BIT(11); // can't use CRUSH cause that is the same as DOOR_DONT_LINK

#define Q3_DOOR_CRUSHER BIT(2) // in Q3 this disables the auto reverse so the blocking player takes damage every frame

#ifdef CSQC
// stuff for preload

.float door_finished;
#endif
