Skip to content

Commit

Permalink
server: code review fixes for PR #197
Browse files Browse the repository at this point in the history
  • Loading branch information
APAmk2 authored and SNMetamorph committed Nov 23, 2023
1 parent 4845f7c commit 1f44613
Show file tree
Hide file tree
Showing 49 changed files with 440 additions and 433 deletions.
1 change: 0 additions & 1 deletion server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ list(APPEND SVDLL_SOURCES
"ggrenade.cpp"
"globals.cpp"
"h_battery.cpp"
"healthkit.cpp"
"h_cycler.cpp"
"items.cpp"
"lights.cpp"
Expand Down
1 change: 1 addition & 0 deletions server/entities/apache_rocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

class CApacheHVR : public CGrenade
{
public:
DECLARE_CLASS( CApacheHVR, CGrenade );
void Spawn( void );
void Precache( void );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// CONTROLLER ZAPBALL
//=========================================================

#include "controller_zapball.h"
#include "controller_energy_ball.h"

LINK_ENTITY_TO_CLASS( controller_energy_ball, CControllerZapBall );

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// CONTROLLER HEADBALL
//=========================================================

#include "controller_headball.h"
#include "controller_head_ball.h"

LINK_ENTITY_TO_CLASS( controller_head_ball, CControllerHeadBall );

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//=========================================================
// Gargantua
//=========================================================
#include "gargantua_smoker.h"
#include "env_smoker.h"

LINK_ENTITY_TO_CLASS( env_smoker, CSmoker );

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//-------------------------------------------------------------
// Wall mounted health kit
//-------------------------------------------------------------
#include "healthkit.h"
#include "func_healthcharger.h"

LINK_ENTITY_TO_CLASS(func_healthcharger, CWallHealth);

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//=========================================================
// monster template
//=========================================================
#include "info_BM.h"
#include "info_bigmomma.h"

LINK_ENTITY_TO_CLASS( info_bigmomma, CInfoBM );

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
****/

#include "nihilanth_hvr.h"
#include "nihilanth_energy_ball.h"

LINK_ENTITY_TO_CLASS( nihilanth_energy_ball, CNihilanthHVR );

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//=========================================================
// Gargantua
//=========================================================
#include "gargantua_spiral.h"
#include "streak_spiral.h"

extern void StreakSplash(const Vector &origin, const Vector &direction, int color, int count, int speed, int velocityRange);

Expand Down
File renamed without changes.
52 changes: 52 additions & 0 deletions server/monsters/agrunt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,58 @@ BEGIN_DATADESC( CAGrunt )
DEFINE_FIELD( m_iLastWord, FIELD_INTEGER ),
END_DATADESC()

const char *CAGrunt::pAttackHitSounds[] =
{
"zombie/claw_strike1.wav",
"zombie/claw_strike2.wav",
"zombie/claw_strike3.wav",
};

const char *CAGrunt::pAttackMissSounds[] =
{
"zombie/claw_miss1.wav",
"zombie/claw_miss2.wav",
};

const char *CAGrunt::pAttackSounds[] =
{
"agrunt/ag_attack1.wav",
"agrunt/ag_attack2.wav",
"agrunt/ag_attack3.wav",
};

const char *CAGrunt::pDieSounds[] =
{
"agrunt/ag_die1.wav",
"agrunt/ag_die4.wav",
"agrunt/ag_die5.wav",
};

const char *CAGrunt::pPainSounds[] =
{
"agrunt/ag_pain1.wav",
"agrunt/ag_pain2.wav",
"agrunt/ag_pain3.wav",
"agrunt/ag_pain4.wav",
"agrunt/ag_pain5.wav",
};

const char *CAGrunt::pIdleSounds[] =
{
"agrunt/ag_idle1.wav",
"agrunt/ag_idle2.wav",
"agrunt/ag_idle3.wav",
"agrunt/ag_idle4.wav",
};

const char *CAGrunt::pAlertSounds[] =
{
"agrunt/ag_alert1.wav",
"agrunt/ag_alert3.wav",
"agrunt/ag_alert4.wav",
"agrunt/ag_alert5.wav",
};

//=========================================================
// IRelationship - overridden because Human Grunts are
// Alien Grunt's nemesis.
Expand Down
52 changes: 0 additions & 52 deletions server/monsters/agrunt.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,55 +126,3 @@ class CAGrunt : public CSquadMonster
float m_flNextWordTime;
int m_iLastWord;
};

const char *CAGrunt::pAttackHitSounds[] =
{
"zombie/claw_strike1.wav",
"zombie/claw_strike2.wav",
"zombie/claw_strike3.wav",
};

const char *CAGrunt::pAttackMissSounds[] =
{
"zombie/claw_miss1.wav",
"zombie/claw_miss2.wav",
};

const char *CAGrunt::pAttackSounds[] =
{
"agrunt/ag_attack1.wav",
"agrunt/ag_attack2.wav",
"agrunt/ag_attack3.wav",
};

const char *CAGrunt::pDieSounds[] =
{
"agrunt/ag_die1.wav",
"agrunt/ag_die4.wav",
"agrunt/ag_die5.wav",
};

const char *CAGrunt::pPainSounds[] =
{
"agrunt/ag_pain1.wav",
"agrunt/ag_pain2.wav",
"agrunt/ag_pain3.wav",
"agrunt/ag_pain4.wav",
"agrunt/ag_pain5.wav",
};

const char *CAGrunt::pIdleSounds[] =
{
"agrunt/ag_idle1.wav",
"agrunt/ag_idle2.wav",
"agrunt/ag_idle3.wav",
"agrunt/ag_idle4.wav",
};

const char *CAGrunt::pAlertSounds[] =
{
"agrunt/ag_alert1.wav",
"agrunt/ag_alert3.wav",
"agrunt/ag_alert4.wav",
"agrunt/ag_alert5.wav",
};
3 changes: 3 additions & 0 deletions server/monsters/barney.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ LINK_ENTITY_TO_CLASS( monster_barney_dead, CDeadBarney );
//=========================================================
// ********** DeadBarney SPAWN **********
//=========================================================

char *CDeadBarney::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach" };

void CDeadBarney :: Spawn( )
{
PRECACHE_MODEL("models/barney.mdl");
Expand Down
2 changes: 0 additions & 2 deletions server/monsters/barney.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,3 @@ class CDeadBarney : public CBaseMonster
int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[3];
};

char *CDeadBarney::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach" };
62 changes: 61 additions & 1 deletion server/monsters/bigmomma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//=========================================================
#include "bigmomma.h"
#include "bigmomma_mortar.h"
#include "info_BM.h"
#include "info_bigmomma.h"

extern void MortarSpray(const Vector &position, const Vector &direction, int spriteModel, int count);

Expand All @@ -32,6 +32,66 @@ BEGIN_DATADESC( CBigMomma )
DEFINE_FIELD( m_crabCount, FIELD_INTEGER ),
END_DATADESC()

const char *CBigMomma::pChildDieSounds[] =
{
"gonarch/gon_childdie1.wav",
"gonarch/gon_childdie2.wav",
"gonarch/gon_childdie3.wav",
};

const char *CBigMomma::pSackSounds[] =
{
"gonarch/gon_sack1.wav",
"gonarch/gon_sack2.wav",
"gonarch/gon_sack3.wav",
};

const char *CBigMomma::pDeathSounds[] =
{
"gonarch/gon_die1.wav",
};

const char *CBigMomma::pAttackSounds[] =
{
"gonarch/gon_attack1.wav",
"gonarch/gon_attack2.wav",
"gonarch/gon_attack3.wav",
};
const char *CBigMomma::pAttackHitSounds[] =
{
"zombie/claw_strike1.wav",
"zombie/claw_strike2.wav",
"zombie/claw_strike3.wav",
};

const char *CBigMomma::pBirthSounds[] =
{
"gonarch/gon_birth1.wav",
"gonarch/gon_birth2.wav",
"gonarch/gon_birth3.wav",
};

const char *CBigMomma::pAlertSounds[] =
{
"gonarch/gon_alert1.wav",
"gonarch/gon_alert2.wav",
"gonarch/gon_alert3.wav",
};

const char *CBigMomma::pPainSounds[] =
{
"gonarch/gon_pain2.wav",
"gonarch/gon_pain4.wav",
"gonarch/gon_pain5.wav",
};

const char *CBigMomma::pFootSounds[] =
{
"gonarch/gon_step1.wav",
"gonarch/gon_step2.wav",
"gonarch/gon_step3.wav",
};

//=========================================================
// Classify - indicates this monster's place in the
// relationship table.
Expand Down
60 changes: 0 additions & 60 deletions server/monsters/bigmomma.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,63 +141,3 @@ class CBigMomma : public CBaseMonster
float m_painSoundTime;
int m_crabCount;
};

const char *CBigMomma::pChildDieSounds[] =
{
"gonarch/gon_childdie1.wav",
"gonarch/gon_childdie2.wav",
"gonarch/gon_childdie3.wav",
};

const char *CBigMomma::pSackSounds[] =
{
"gonarch/gon_sack1.wav",
"gonarch/gon_sack2.wav",
"gonarch/gon_sack3.wav",
};

const char *CBigMomma::pDeathSounds[] =
{
"gonarch/gon_die1.wav",
};

const char *CBigMomma::pAttackSounds[] =
{
"gonarch/gon_attack1.wav",
"gonarch/gon_attack2.wav",
"gonarch/gon_attack3.wav",
};
const char *CBigMomma::pAttackHitSounds[] =
{
"zombie/claw_strike1.wav",
"zombie/claw_strike2.wav",
"zombie/claw_strike3.wav",
};

const char *CBigMomma::pBirthSounds[] =
{
"gonarch/gon_birth1.wav",
"gonarch/gon_birth2.wav",
"gonarch/gon_birth3.wav",
};

const char *CBigMomma::pAlertSounds[] =
{
"gonarch/gon_alert1.wav",
"gonarch/gon_alert2.wav",
"gonarch/gon_alert3.wav",
};

const char *CBigMomma::pPainSounds[] =
{
"gonarch/gon_pain2.wav",
"gonarch/gon_pain4.wav",
"gonarch/gon_pain5.wav",
};

const char *CBigMomma::pFootSounds[] =
{
"gonarch/gon_step1.wav",
"gonarch/gon_step2.wav",
"gonarch/gon_step3.wav",
};
2 changes: 2 additions & 0 deletions server/monsters/bullsquid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ BEGIN_DATADESC( CBullsquid )
DEFINE_FIELD( m_flNextSpitTime, FIELD_TIME ),
END_DATADESC()

int iSquidSpitSprite;

//=========================================================
// IgnoreConditions
//=========================================================
Expand Down
2 changes: 1 addition & 1 deletion server/monsters/bullsquid.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define SQUID_SPRINT_DIST 256 // how close the squid has to get before starting to sprint and refusing to swerve

int iSquidSpitSprite;
extern int iSquidSpitSprite;

//=========================================================
// monster-specific schedule types
Expand Down
Loading

0 comments on commit 1f44613

Please sign in to comment.