Cleaning up some warnings.

This commit is contained in:
Marco Cawthorne 2022-02-01 13:37:21 -08:00
parent 1beb466b81
commit bcf9e2e758
Signed by: eukara
GPG Key ID: C196CD8BA993248A
14 changed files with 34 additions and 30 deletions

View File

@ -47,7 +47,7 @@ FX_Corpse_Next(void)
entity
FX_Corpse_Spawn(player pl, float anim)
{
NSRenderableEntity body_next = FX_Corpse_Next();
NSRenderableEntity body_next = (NSRenderableEntity)FX_Corpse_Next();
setorigin(body_next, pl.origin + [0,0,32]);
setmodel(body_next, pl.model);
setsize(body_next, VEC_HULL_MIN, VEC_HULL_MAX);
@ -60,4 +60,4 @@ FX_Corpse_Spawn(player pl, float anim)
body_next.SetFrame(anim);
return (entity)body_next;
}
#endif
#endif

View File

@ -312,14 +312,7 @@ CSQC_UpdateView(float w, float h, float focus)
}
}
if (pSeat->m_flShakeDuration > 0.0) {
vector vecShake = [0,0,0];
vecShake[0] += random() * 3;
vecShake[1] += random() * 3;
vecShake[2] += random() * 3;
pl.punchangle += (vecShake * pSeat->m_flShakeAmp) * (pSeat->m_flShakeDuration / pSeat->m_flShakeTime);
pSeat->m_flShakeDuration -= clframetime;
}
Shake_Update(pl);
setproperty(VF_ANGLES, view_angles + pl.punchangle);
} else if (getplayerkeyvalue(pl.entnum-1, "*spec") == "1") {
spec = (spectator)self;
@ -353,15 +346,7 @@ CSQC_UpdateView(float w, float h, float focus)
}
} else if (getplayerkeyvalue(pl.entnum-1, "*spec") == "2") {
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin);
if (pSeat->m_flShakeDuration > 0.0) {
vector vecShake = [0,0,0];
vecShake[0] += random() * 3;
vecShake[1] += random() * 3;
vecShake[2] += random() * 3;
pl.punchangle += (vecShake * pSeat->m_flShakeAmp) * (pSeat->m_flShakeDuration / pSeat->m_flShakeTime);
pSeat->m_flShakeDuration -= clframetime;
}
Shake_Update(pl);
setproperty(VF_ANGLES, view_angles + pl.punchangle);
}

View File

@ -22,5 +22,6 @@ vgui.qc
way.qc
efx.qc
detailtex.qc
shake.qc
entry.qc
#endlist

12
src/client/shake.qc Normal file
View File

@ -0,0 +1,12 @@
void
Shake_Update(player pl)
{
if (pSeat->m_flShakeDuration > 0.0) {
vector vecShake = [0,0,0];
vecShake[0] += random() * 3;
vecShake[1] += random() * 3;
vecShake[2] += random() * 3;
pl.punchangle += (vecShake * pSeat->m_flShakeAmp) * (pSeat->m_flShakeDuration / pSeat->m_flShakeTime);
pSeat->m_flShakeDuration -= clframetime;
}
}

View File

@ -103,7 +103,7 @@ momentary_rot_button::MovementStateChanged(void)
vector vecAngleDifference;
float flTravelLength;
float flTravelTime;
float flSpeed;
float flSpeed = 0;
switch (m_iMoveState) {
case MOMENTARY_IDLE:

View File

@ -43,10 +43,12 @@ prop_dynamic::Respawn(void)
{
super::Respawn();
SetModel(GetSpawnModel());
UpdateBounds();
//UpdateBounds();
if (spawnflags & PRPDYN_NONSOLID)
SetSolid(SOLID_NOT);
SetSolid(SOLID_BBOX);
}
void

View File

@ -289,6 +289,9 @@ NSEntity::UpdateBounds(void)
vector newMins, newMaxs;
float flScale = 1.0f;
newMins = m_vecMins;
newMaxs = m_vecMaxs;
/* avoid useless computation */
if (angles != [0,0,0]) {
/* adjust bbox according to rotation */

View File

@ -368,7 +368,7 @@ NSMonster::FreeStateMoved(void)
dprint("NSMonster::FreeStateMoved\n");
new_origin = gettaginfo(this, 1);
SetOrigin(new_origin);
droptofloor(this);
droptofloor();
FreeState();
}

View File

@ -220,7 +220,7 @@ NSSurfacePropEntity::Death(void)
if (GetPropData(PROPINFO_SKIN) != 0) {
SetSkin(GetPropData(PROPINFO_SKIN));
} else if (GetPropData(PROPINFO_BREAKMODEL)) {
} else if (GetPropData(PROPINFO_BREAKMODEL) != __NULL__) {
string gibeffect = GetPropData(PROPINFO_BREAKMODEL);
int breakcount = GetPropData(PROPINFO_BREAKCOUNT);
BreakModel_Spawn(absmin, absmax, [0,0,0], 100, breakcount, gibeffect);
@ -280,7 +280,7 @@ NSSurfacePropEntity::predraw(void)
m_flBurnNext = time + 0.1f;
}
}
super::predraw();
return super::predraw();
}
#endif

View File

@ -341,7 +341,7 @@ menu_customize_init(void)
cz_3dModel = spawn(CUI3DView);
cz_3dModel.SetPos(410,160);
cz_3dModel.SetSize(170,221);
cz_3dModel.SetSize([170,221]);
cz_3dModel.SetDrawFunc(ModelPreview_Draw);
cz_3dModel.SetInputFunc(ModelPreview_Input);
Widget_Add(fn_customize, cz_3dModel);

View File

@ -14,18 +14,21 @@ Achievement_Clear(string strName)
int
Achievement_Get(string strName)
{
return 0;
}
/* get the icon of an achievement */
string
Achievement_GetIcon(string strName)
{
return __NULL__;
}
/* STUB, returns how many other users achieved this */
float
Achievement_GetPercentage(string strName)
{
return 0.0f;
}
/* called when you want to show a pop-up indicating progress */

View File

@ -184,8 +184,8 @@ CGameRules::DamageApply(entity t, entity c, float dmg, int w, damageType_t type)
base_player tp = (base_player)t;
/* for armor damage */
float flArmor;
float flNewDamage;
float flArmor = 0;
float flNewDamage = 0;
/* player god mode */
if (t.flags & FL_CLIENT && t.flags & FL_GODMODE)

View File

@ -562,8 +562,6 @@ void
Sound_PlayLocal(string shader)
{
int r;
float radius;
float pitch;
int flag;
int sample;

View File

@ -25,7 +25,7 @@ var int g_vguiWidgetCount;
var float UI_MAINALPHA;
#endif
void
int
VGUI_Active(void)
{
return (g_vguiWidgetCount > 0) ? TRUE : FALSE;