Make Client_InIntermission() a shared (Client/Server) function, add method 'InIntermission()' to CGameRules.
Tone down the intermission view movement, also tweak Spawn_SelectRandom() to find more points.
This commit is contained in:
parent
dd26664ac4
commit
8c3804a1bc
7 changed files with 29 additions and 11 deletions
|
@ -335,7 +335,7 @@ CSQC_UpdateView(float w, float h, float focus)
|
|||
|
||||
if (Client_InIntermission()) {
|
||||
view_angles = pSeat->m_vecCameraAngle;
|
||||
view_angles += [sin(time), sin(time * 2)];
|
||||
view_angles += [sin(time), sin(time * 1.5f)] * 0.1f;
|
||||
setproperty(VF_ORIGIN, pSeat->m_vecCameraOrigin);
|
||||
setproperty(VF_CL_VIEWANGLES, view_angles);
|
||||
}
|
||||
|
|
|
@ -30,11 +30,4 @@ float
|
|||
Client_IsPlayer(base_client cl)
|
||||
{
|
||||
return (cl.classname == "player") ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
Client_InIntermission(void)
|
||||
{
|
||||
return g_iIntermission;
|
||||
}
|
||||
}
|
|
@ -53,6 +53,7 @@ class CGameRules
|
|||
virtual void(void) IntermissionStart;
|
||||
virtual void(void) IntermissionCycle;
|
||||
virtual void(void) IntermissionEnd;
|
||||
virtual int(void) InIntermission;
|
||||
|
||||
virtual float(void) IsTeamPlay;
|
||||
|
||||
|
|
|
@ -173,6 +173,12 @@ CGameRules::IntermissionCycle(void)
|
|||
|
||||
}
|
||||
|
||||
int
|
||||
CGameRules::InIntermission(void)
|
||||
{
|
||||
return (m_iIntermission) ? 1 : 0;
|
||||
}
|
||||
|
||||
int
|
||||
CGameRules::MonstersSpawn(void)
|
||||
{
|
||||
|
|
|
@ -90,7 +90,14 @@ entity Spawn_SelectRandom(string cname)
|
|||
static entity lastspot;
|
||||
entity spot = lastspot;
|
||||
|
||||
for (int i = random(1, 5); i > 0; i--) {
|
||||
float max = 0;
|
||||
|
||||
/* count our max count */
|
||||
for (entity e = world;(e = find(e, ::classname, cname));) {
|
||||
max++;
|
||||
}
|
||||
|
||||
for (int i = random(1, max); i > 0; i--) {
|
||||
spot = find(spot, classname, cname);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,3 +47,14 @@ base_client::base_client(void)
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
Client_InIntermission(void)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
return g_iIntermission;
|
||||
#else
|
||||
return (float)g_grMode.InIntermission();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ base_player::PostFrame(void)
|
|||
void
|
||||
base_player::ClientInput(void)
|
||||
{
|
||||
if (IsFakeSpectator()) {
|
||||
if (!Client_InIntermission() && IsFakeSpectator()) {
|
||||
spectator::ClientInput();
|
||||
SpectatorTrackPlayer();
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue