From 5e921bf59373d79d27c322ff86e8b5a37b151e45 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 31 Jul 2022 16:02:10 +0100 Subject: Add magical feature codegen system, at long last --- src/democustom.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/democustom.c') diff --git a/src/democustom.c b/src/democustom.c index 0a1174f..c7de77b 100644 --- a/src/democustom.c +++ b/src/democustom.c @@ -22,12 +22,18 @@ #include "demorec.h" #include "engineapi.h" #include "errmsg.h" +#include "feature.h" #include "gamedata.h" #include "intdefs.h" #include "mem.h" #include "ppmagic.h" #include "vcall.h" +FEATURE() +REQUIRE(demorec) +REQUIRE_GAMEDATA(vtidx_GetEngineBuildNumber) +REQUIRE_GAMEDATA(vtidx_RecordPacket) + static int nbits_msgtype, nbits_datalen; // The engine allows usermessages up to 255 bytes, we add 2 bytes of overhead, @@ -107,12 +113,7 @@ static bool find_WriteMessages(void) { DECL_VFUNC_DYN(int, GetEngineBuildNumber) -bool democustom_init(void) { - if (!has_vtidx_GetEngineBuildNumber || !has_vtidx_RecordPacket) { - errmsg_errorx("missing gamedata entries for this engine"); - return false; - } - +INIT { // More UncraftedkNowledge: // > yeah okay so [the usermessage length is] 11 bits if the demo protocol // > is 11 or if the game is l4d2 and the network protocol is 2042. -- cgit v1.2.3