diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2022-07-31 16:02:10 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2022-08-10 22:40:52 +0100 |
commit | 5e921bf59373d79d27c322ff86e8b5a37b151e45 (patch) | |
tree | 4d40e39543b085ce4c8cb9b1a7b3c0108de680c0 /src/democustom.c | |
parent | c8d7588251fd4fe63ac6afe2a90ca7066c786609 (diff) |
Add magical feature codegen system, at long last
Diffstat (limited to 'src/democustom.c')
-rw-r--r-- | src/democustom.c | 13 |
1 files changed, 7 insertions, 6 deletions
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. |