added PR_PatchRereleaseBuiltins for Quake 2021 rerelease update 1,

and removed the relevant centerprint, bprint, and sprint entries
from pr_builtins[].

cherry-picked from the original patch for vkQuake by Andrei Drexler
This commit is contained in:
Ozkan Sezer 2022-04-21 03:25:24 +03:00
parent d119208ab2
commit 43a85fb24f
2 changed files with 22 additions and 3 deletions

View File

@ -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;

View File

@ -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 ();
}