Client: Add Weapons_EnableModel() and Weapons_DisableModel() so weapons can
manually control the visibility regardless of viewzoom setting
This commit is contained in:
parent
574980bb1d
commit
147969e8a8
5 changed files with 38 additions and 4 deletions
|
@ -64,6 +64,8 @@ void Weapons_SetModel(string);
|
|||
void Weapons_SetGeomset(string);
|
||||
void Weapons_UpdateAmmo(base_player, int, int, int);
|
||||
int Weapons_GetAnimation(void);
|
||||
void Weapons_EnableModel(void);
|
||||
void Weapons_DisableModel(void);
|
||||
|
||||
void Weapons_Sound(entity, float, string);
|
||||
|
||||
|
|
|
@ -383,6 +383,23 @@ Weapons_IsPresent(player pl, int w)
|
|||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_EnableModel(void)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
View_EnableViewmodel();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_DisableModel(void)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
View_DisableViewmodel();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Weapons_UpdateAmmo
|
||||
|
|
|
@ -90,6 +90,9 @@ void Vox_Play(string);
|
|||
void Event_ProcessModel(float, int, string);
|
||||
void ClientGame_ModelEvent(float, int, string);
|
||||
|
||||
void View_EnableViewmodel(void);
|
||||
void View_DisableViewmodel(void);
|
||||
|
||||
/* this really should be done in-engine */
|
||||
|
||||
void drawrect(vector pos, vector sz, float thickness, vector rgb, float al, optional float dfl)
|
||||
|
|
|
@ -241,3 +241,18 @@ View_GetAnimation(void)
|
|||
{
|
||||
return pSeat->m_eViewModel.frame;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
View_EnableViewmodel(void)
|
||||
{
|
||||
entity m_eViewModel = pSeat->m_eViewModel;
|
||||
m_eViewModel.alpha = 1.0f;
|
||||
}
|
||||
|
||||
void
|
||||
View_DisableViewmodel(void)
|
||||
{
|
||||
entity m_eViewModel = pSeat->m_eViewModel;
|
||||
m_eViewModel.alpha = 0.0f;
|
||||
}
|
|
@ -218,9 +218,7 @@ CBaseVehicle::PlayerEnter(base_player pl)
|
|||
pl.vehicle = this;
|
||||
pl.flags |= FL_INVEHICLE;
|
||||
|
||||
#ifdef SERVER
|
||||
SetSendFlags(VEHFL_CHANGED_DRIVER);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -238,9 +236,7 @@ CBaseVehicle::PlayerLeave(base_player pl)
|
|||
pl.vehicle = __NULL__;
|
||||
m_eDriver = __NULL__;
|
||||
|
||||
#ifdef SERVER
|
||||
SetSendFlags(VEHFL_CHANGED_DRIVER);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -248,6 +244,7 @@ CBaseVehicle::CBaseVehicle(void)
|
|||
{
|
||||
CBaseEntity::CBaseEntity();
|
||||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
void
|
||||
basevehicle_readentity(float isnew)
|
||||
|
|
Loading…
Reference in a new issue