2021-03-08 01:53:48 -08:00
|
|
|
/*
|
2022-03-13 16:57:51 -07:00
|
|
|
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
|
2021-03-08 01:53:48 -08:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2022-03-15 19:34:26 -07:00
|
|
|
void Weapons_Draw(player pl);
|
2022-01-04 21:55:40 -08:00
|
|
|
|
|
|
|
void
|
|
|
|
CSEv_PlayerSwitchWeapon_i(int w)
|
2021-03-08 01:53:48 -08:00
|
|
|
{
|
|
|
|
player pl = (player)self;
|
2021-09-17 16:33:26 -07:00
|
|
|
|
|
|
|
if (pl.activeweapon != w) {
|
|
|
|
pl.activeweapon = w;
|
2022-03-15 19:34:26 -07:00
|
|
|
Weapons_Draw(pl);
|
2021-09-17 16:33:26 -07:00
|
|
|
}
|
2021-03-08 01:53:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Player_Precache(void)
|
|
|
|
{
|
|
|
|
searchhandle pm;
|
|
|
|
pm = search_begin("models/player/*/*.mdl", TRUE, TRUE);
|
|
|
|
for (int i = 0; i < search_getsize(pm); i++) {
|
|
|
|
precache_model(search_getfilename(pm, i));
|
|
|
|
}
|
|
|
|
search_end(pm);
|
|
|
|
}
|