diff --git a/Quake/pr_cmds.c b/Quake/pr_cmds.c index 8bb86770..e202b05f 100644 --- a/Quake/pr_cmds.c +++ b/Quake/pr_cmds.c @@ -1814,9 +1814,6 @@ static builtin_t pr_builtin[] = PF_Fixme, // void draw_worldtext (string s, vector origin, float size, float lifetime, float depthtest) = #87 PF_Fixme, // void draw_sphere (vector origin, float radius, float colormap, float lifetime, float depthtest) = #88 PF_Fixme, // void draw_cylinder (vector origin, float halfHeight, float radius, float colormap, float lifetime, float depthtest) = #89 - PF_centerprint , // #90 - PF_bprint, - PF_sprint, }; builtin_t *pr_builtins = pr_builtin; diff --git a/Quake/pr_edict.c b/Quake/pr_edict.c index 1ce58f18..e42b1fa8 100644 --- a/Quake/pr_edict.c +++ b/Quake/pr_edict.c @@ -1073,6 +1073,27 @@ static int PR_FindSupportedEffects (void) } +/* +=============== +PR_PatchRereleaseBuiltins + +Quake 2021 release update 1 adds bprint/sprint/centerprint builtins with new id's +(see https://steamcommunity.com/games/2310/announcements/detail/2943653788150871156) +This function patches them back to use the old indices +=============== +*/ +static void PR_PatchRereleaseBuiltins (void) +{ + dfunction_t *f; + if ((f = ED_FindFunction ("centerprint")) != NULL && f->first_statement == -90) + f->first_statement = -73; + if ((f = ED_FindFunction ("bprint")) != NULL && f->first_statement == -91) + f->first_statement = -23; + if ((f = ED_FindFunction ("sprint")) != NULL && f->first_statement == -92) + f->first_statement = -24; +} + + /* =============== PR_LoadProgs @@ -1178,6 +1199,7 @@ void PR_LoadProgs (void) pr_edict_size += sizeof(void *) - 1; pr_edict_size &= ~(sizeof(void *) - 1); + PR_PatchRereleaseBuiltins (); pr_effects_mask = PR_FindSupportedEffects (); }