Server: Move footstep precaches into Footsteps_Init

This commit is contained in:
Marco Cawthorne 2020-10-30 13:29:37 +01:00
parent 97d19c1b37
commit 69fa528822
4 changed files with 79 additions and 34 deletions

View file

@ -25,6 +25,7 @@
#include "plugins.h"
#include "vehicles.h"
#include "traceattack.h"
#include "footsteps.h"
#define CLASSEXPORT(classname,classa) void classname(void) { spawnfunc_##classa(); }

View file

@ -182,40 +182,7 @@ void initents(void)
precache_sound("debris/concrete2.wav");
precache_sound("debris/concrete3.wav");
Sound_Precache("step_default.left");
Sound_Precache("step_default.right");
Sound_Precache("step_alien.left");
Sound_Precache("step_alien.right");
Sound_Precache("step_bloodyflesh.left");
Sound_Precache("step_bloodyflesh.right");
Sound_Precache("step_computer.left");
Sound_Precache("step_computer.right");
Sound_Precache("step_concrete.left");
Sound_Precache("step_concrete.right");
Sound_Precache("step_dirt.left");
Sound_Precache("step_dirt.right");
Sound_Precache("step_flesh.left");
Sound_Precache("step_flesh.right");
Sound_Precache("step_foliage.left");
Sound_Precache("step_foliage.right");
Sound_Precache("step_glass.left");
Sound_Precache("step_glass.right");
Sound_Precache("step_grate.left");
Sound_Precache("step_grate.right");
Sound_Precache("step_metal.left");
Sound_Precache("step_metal.right");
Sound_Precache("step_slosh.left");
Sound_Precache("step_slosh.right");
Sound_Precache("step_snow.left");
Sound_Precache("step_snow.right");
Sound_Precache("step_tile.left");
Sound_Precache("step_tile.right");
Sound_Precache("step_vent.left");
Sound_Precache("step_vent.right");
Sound_Precache("step_wood.left");
Sound_Precache("step_wood.right");
Sound_Precache("step_ladder.left");
Sound_Precache("step_ladder.right");
Footsteps_Init();
precache_sound("player/pl_fallpain3.wav");
precache_sound("items/9mmclip1.wav");

View file

@ -31,6 +31,45 @@
#define MATID_VENT 'V'
#define MATID_WOOD 'W'
void
Footsteps_Init(void)
{
Sound_Precache("step_default.left");
Sound_Precache("step_default.right");
Sound_Precache("step_alien.left");
Sound_Precache("step_alien.right");
Sound_Precache("step_bloodyflesh.left");
Sound_Precache("step_bloodyflesh.right");
Sound_Precache("step_computer.left");
Sound_Precache("step_computer.right");
Sound_Precache("step_concrete.left");
Sound_Precache("step_concrete.right");
Sound_Precache("step_dirt.left");
Sound_Precache("step_dirt.right");
Sound_Precache("step_flesh.left");
Sound_Precache("step_flesh.right");
Sound_Precache("step_foliage.left");
Sound_Precache("step_foliage.right");
Sound_Precache("step_glass.left");
Sound_Precache("step_glass.right");
Sound_Precache("step_grate.left");
Sound_Precache("step_grate.right");
Sound_Precache("step_metal.left");
Sound_Precache("step_metal.right");
Sound_Precache("step_slosh.left");
Sound_Precache("step_slosh.right");
Sound_Precache("step_snow.left");
Sound_Precache("step_snow.right");
Sound_Precache("step_tile.left");
Sound_Precache("step_tile.right");
Sound_Precache("step_vent.left");
Sound_Precache("step_vent.right");
Sound_Precache("step_wood.left");
Sound_Precache("step_wood.right");
Sound_Precache("step_ladder.left");
Sound_Precache("step_ladder.right");
}
/* Valve Half-Life BSP */
void
Footsteps_HLBSP(base_player target)

38
src/server/footsteps.h Executable file
View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* HLBSP materials.txt character id's */
#define MATID_ALIEN 'H'
#define MATID_BLOODYFLESH 'B'
#define MATID_COMPUTER 'P'
#define MATID_CONCRETE 'C'
#define MATID_DIRT 'D'
#define MATID_FLESH 'F'
#define MATID_FOLIAGE 'O'
#define MATID_GLASS 'Y'
#define MATID_GRATE 'G'
#define MATID_METAL 'M'
#define MATID_SLOSH 'S'
#define MATID_SNOW 'N'
#define MATID_TILE 'T'
#define MATID_VENT 'V'
#define MATID_WOOD 'W'
void Footsteps_Init(void);
void Footsteps_HLBSP(base_player target);
void Footsteps_VVBSP(base_player target);
void Footsteps_Default(base_player target);
void Footsteps_Update(void);