From 75b05838a1ae8fe1c655dd3078241eca7b8593cd Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sat, 11 May 2024 18:34:17 +0300 Subject: [PATCH] game: use defines for DOOR_ANIMATED and DOOR_ANIMATED_FAST Based on: * https://github.com/id-Software/quake2-rerelease-dll/blob/main/rerelease/g_func.cpp --- src/game/g_func.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game/g_func.c b/src/game/g_func.c index 95cbfd72..f6bf4c88 100644 --- a/src/game/g_func.c +++ b/src/game/g_func.c @@ -43,10 +43,13 @@ #define DOOR_REVERSE 2 #define DOOR_CRUSHER 4 #define DOOR_NOMONSTER 8 +#define DOOR_ANIMATED 16 #define DOOR_TOGGLE 32 +#define DOOR_ANIMATED_FAST 64 #define DOOR_X_AXIS 64 #define DOOR_Y_AXIS 128 #define DOOR_INACTIVE 8192 +#define DOOR_SAFE_OPEN 0x20000 #define AccelerationDistance(target, rate) (target * ((target / rate) + 1) / 2) @@ -1715,7 +1718,7 @@ SP_func_rotating(edict_t *ent) ent->use(ent, NULL, NULL); } - if (ent->spawnflags & 64) + if (ent->spawnflags & DOOR_ANIMATED_FAST) { ent->s.effects |= EF_ANIM_ALL; } @@ -2709,12 +2712,12 @@ SP_func_door(edict_t *ent) VectorCopy(ent->pos2, ent->moveinfo.end_origin); VectorCopy(ent->s.angles, ent->moveinfo.end_angles); - if (ent->spawnflags & 16) + if (ent->spawnflags & DOOR_ANIMATED) { ent->s.effects |= EF_ANIM_ALL; } - if (ent->spawnflags & 64) + if (ent->spawnflags & DOOR_ANIMATED_FAST) { ent->s.effects |= EF_ANIM_ALLFAST; } @@ -2916,7 +2919,7 @@ SP_func_door_rotating(edict_t *ent) VectorCopy(ent->s.origin, ent->moveinfo.end_origin); VectorCopy(ent->pos2, ent->moveinfo.end_angles); - if (ent->spawnflags & 16) + if (ent->spawnflags & DOOR_ANIMATED) { ent->s.effects |= EF_ANIM_ALL; }