From cf0354eb8e043fcd9c6c17756701972f948a16f1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 22 Aug 2024 00:02:48 +0100 Subject: Rewrite the gamedata and entprops systems entirely This removes the horrible janky old KeyValues parser and replaces it with a couple of trivial ad-hoc text parsers. In doing so, make the format of the actual gamedata files more human-friendly too. We also gain support for nested SendTables in mkentprops, which are required to get at various things like player velocity. And, the actual string matching is made more efficient (or, at least, more scalable) by way of a cool radix tree thing which generates a bunch of switch cases on distinct characters. --- src/l4dwarp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/l4dwarp.c') diff --git a/src/l4dwarp.c b/src/l4dwarp.c index d24e39c..c17c7b8 100644 --- a/src/l4dwarp.c +++ b/src/l4dwarp.c @@ -44,8 +44,8 @@ DEF_CCMD_HERE_UNREG(sst_l4d_testwarp, "Simulate a bot warping to you", struct edict *ed = ent_getedict(con_cmdclient + 1); if_cold (!ed) { errmsg_errorx("couldn't access player entity"); return; } void *e = GetBaseEntity(ed->ent_unknown); // is this call required? - struct vec3f *org = mem_offset(e, off_entpos); - struct vec3f *ang = mem_offset(e, off_eyeang); + const struct vec3f *org = mem_offset(e, off_entpos); + const struct vec3f *ang = mem_offset(e, off_eyeang); // L4D idle warps go up to 10 units behind yaw, lessening based on pitch. float pitch = ang->x * M_PI / 180, yaw = ang->y * M_PI / 180; float shift = -10 * cos(pitch); -- cgit v1.2.3