rules/deathmatch: move precaches into their own dedicated function

This commit is contained in:
Marco Cawthorne 2025-02-13 23:24:43 -08:00
parent 7fc646492d
commit e65f81ae23
5 changed files with 39 additions and 28 deletions

View file

@ -25,9 +25,10 @@ Git clone [Nuclide](https://code.idtech.space/vera/nuclide) first, run `make upd
``` ```
git clone https://code.idtech.space/fn/hl2 hl2 git clone https://code.idtech.space/fn/hl2 hl2
make game GAME=hl2 make game GAME=hl2
make plugins GAME=hl2
``` ```
The last command will build the game-logic. The last command will build the plugins required for the engine to load the data files. The one before it will build the game-logic.
Make sure that Nuclide-SDK has `fteqcc` and `fteqw` present for building and running, respectively. Make sure that Nuclide-SDK has `fteqcc` and `fteqw` present for building and running, respectively.
It will also respect versions installed by the package manager, just make sure it's up to date. It will also respect versions installed by the package manager, just make sure it's up to date.

View file

@ -1,9 +1,9 @@
#define FULLENGINENAME "Rad-Therapy II" #define FULLENGINENAME "Rad-Therapy II"
#define GAME_SHORTNAME "halflife2" #define GAME_SHORTNAME "halflife2"
#define GAME_BASEGAMES "hl2","hl2mp" #define GAME_BASEGAMES "hl2","hl2mp"
#define GAME_PROTOCOL "FTE-RadTherapy2" #define GAME_PROTOCOL "Rad-Therapy-II"
#define GAME_DEFAULTCMDS "game_hl2;fteplug_ffmpeg;fteplug_hl2;fteplug_ode;plug_load ffmpeg;plug_load hl2;plug_load ode" #define GAME_DEFAULTCMDS "hl2-patch-radtherapy2;fteplug_ffmpeg;fteplug_ode;fteplug_hl2;exec quake.rc"
#define GAME_DOWNLOADSURL "https://www.frag-net.com/pkgs/list" #define GAME_DOWNLOADSURL "https://www.frag-net.com/pkgs/halflife2.txt"
#define BRANDING_ICON "freecs.ico" #define BRANDING_ICON "freecs.ico"
#define DISTRIBUTION "RT2" #define DISTRIBUTION "RT2"

View file

@ -2,3 +2,6 @@ exec default_controls.cfg
exec default_cvar.cfg exec default_cvar.cfg
exec default_video.cfg exec default_video.cfg
exec default_hl2.cfg exec default_hl2.cfg
plug_load ode
plug_load hl2

View file

@ -1396,27 +1396,27 @@
1 materials/sfx/spot_flare.tga 1 materials/sfx/spot_flare.tga
1 materials/sfx/steam.mat 1 materials/sfx/steam.mat
1 materials/sfx/steam.tga 1 materials/sfx/steam.tga
1 materials/ui/avatar_missing.tga 1 gfx/ui/avatar_missing.tga
1 materials/ui/m_bottom.tga 1 gfx/ui/m_bottom.tga
1 materials/ui/m_bottomleft.tga 1 gfx/ui/m_bottomleft.tga
1 materials/ui/m_bottomright.tga 1 gfx/ui/m_bottomright.tga
1 materials/ui/m_left.tga 1 gfx/ui/m_left.tga
1 materials/ui/m_linebottom.tga 1 gfx/ui/m_linebottom.tga
1 materials/ui/m_linebottomleft.tga 1 gfx/ui/m_linebottomleft.tga
1 materials/ui/m_linebottomright.tga 1 gfx/ui/m_linebottomright.tga
1 materials/ui/m_lineleft.tga 1 gfx/ui/m_lineleft.tga
1 materials/ui/m_linemid.tga 1 gfx/ui/m_linemid.tga
1 materials/ui/m_lineright.tga 1 gfx/ui/m_lineright.tga
1 materials/ui/m_linetop.tga 1 gfx/ui/m_linetop.tga
1 materials/ui/m_linetopleft.tga 1 gfx/ui/m_linetopleft.tga
1 materials/ui/m_linetopright.tga 1 gfx/ui/m_linetopright.tga
1 materials/ui/m_mid.tga 1 gfx/ui/m_mid.tga
1 materials/ui/m_right.tga 1 gfx/ui/m_right.tga
1 materials/ui/m_top.tga 1 gfx/ui/m_top.tga
1 materials/ui/m_topleft.tga 1 gfx/ui/m_topleft.tga
1 materials/ui/m_topright.tga 1 gfx/ui/m_topright.tga
1 materials/ui/voice_off.tga 1 gfx/ui/voice_off.tga
1 materials/ui/voice_on.tga 1 gfx/ui/voice_on.tga
1 models/airboat.mdl.doll 1 models/airboat.mdl.doll
1 models/alyx.mdl.doll 1 models/alyx.mdl.doll
1 models/alyx_emptool_prop.mdl.doll 1 models/alyx_emptool_prop.mdl.doll

View file

@ -58,6 +58,16 @@ AllowFlashlight(void)
return cvars.GetBool("mp_flashlight"); return cvars.GetBool("mp_flashlight");
} }
void
CodeCallback_Precache(void)
{
precache.Entity("player_mp");
for (int i = 0; i < g_stockHL2MPPlayerModels.length; i++) {
precache.Model(g_stockHL2MPPlayerModels[i]);
}
}
void void
CodeCallback_StartGameType(void) CodeCallback_StartGameType(void)
{ {
@ -71,9 +81,6 @@ CodeCallback_StartGameType(void)
} }
game.SetSpawnPoint("info_player_deathmatch"); game.SetSpawnPoint("info_player_deathmatch");
for (int i = 0; i < g_stockHL2MPPlayerModels.length; i++) {
precache.Model(g_stockHL2MPPlayerModels[i]);
}
} }
void void