Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/game/server/gamerules/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2163,29 +2163,29 @@ BOOL CHalfLifeMultiplay :: ClientCommand( CBasePlayer *pPlayer, const char *pcmd
//=========================================================

//#define PLAYERMODEL_HUMAN_MALE1 "../../human/male1/male1"
#define PLAYERMODEL_HUMAN_MALE1 ""
//#define PLAYERMODEL_HUMAN_MALE1 ""

void CHalfLifeMultiplay::ClientUserInfoChanged( CBasePlayer *pPlayer, const char *infobuffer )
{
// prevent skin/color/model changes
const char *mdls = g_engfuncs.pfnInfoKeyValue( infobuffer, "model" );

if ( _stricmp( mdls, PLAYERMODEL_HUMAN_MALE1 ) )
{
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(), g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", PLAYERMODEL_HUMAN_MALE1 );
//_snprintf( text, sizeof(text), "* Unkwnown forces prevent you from shapeshifting...\n" );
//UTIL_SayText( text, pPlayer );
return;
}

//Only allow a name change the first time a client joins
if( pPlayer->m_DisplayName.len() ) //Name already set. Keep that name
{
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(), g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "name", (char *)pPlayer->m_DisplayName );
//pPlayer->pev->netname = ALLOC_STRING(pPlayer->DisplayName());
pPlayer->m_NetName = pPlayer->DisplayName();
pPlayer->pev->netname = MAKE_STRING(pPlayer->m_NetName.c_str());
}
// const char *mdls = g_engfuncs.pfnInfoKeyValue( infobuffer, "model" );

// if ( _stricmp( mdls, PLAYERMODEL_HUMAN_MALE1 ) )
// {
// g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(), g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", PLAYERMODEL_HUMAN_MALE1 );
// //_snprintf( text, sizeof(text), "* Unkwnown forces prevent you from shapeshifting...\n" );
// //UTIL_SayText( text, pPlayer );
// return;
// }

// //Only allow a name change the first time a client joins
// if( pPlayer->m_DisplayName.len() ) //Name already set. Keep that name
// {
// g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(), g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "name", (char *)pPlayer->m_DisplayName );
// //pPlayer->pev->netname = ALLOC_STRING(pPlayer->DisplayName());
// pPlayer->m_NetName = pPlayer->DisplayName();
// pPlayer->pev->netname = MAKE_STRING(pPlayer->m_NetName.c_str());
// }
/*
if( !FStrEq( pPlayer->DisplayName(), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" )) )
//if Tried to change name
Expand Down
10 changes: 3 additions & 7 deletions src/game/server/monsters/bodyparts/bodyparts_human.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include "bodyparts_human.h"
#include "monsters.h"

extern const char* ModelListHumanMale[HUMAN_BODYPARTS];
extern const char* ModelListHumanFemale[HUMAN_BODYPARTS];

CHumanBodypart *CHumanBodypart::Duplicate()
{
CHumanBodypart *pNewBodypart = GetClassPtr((CHumanBodypart *)NULL);
Expand All @@ -23,18 +20,17 @@ void CHumanBody::Initialize(CBaseEntity *pOwner, void *pvData)
if (pvData)
Gender = (int)pvData;

HumanBodypart.Initialize(pOwner, ((Gender > 0) ? ModelListHumanFemale[i] : ModelListHumanMale[i]), i);
Bodyparts.add(&HumanBodypart);
}
}

CBaseBody *CHumanBody::Duplicate()
{
CHumanBody &NewBody = *msnew(CHumanBody);
CHumanBody *NewBody = new CHumanBody;
for (int i = 0; i < Bodyparts.size(); i++)
NewBody.Bodyparts.add(Bodyparts[i]->Duplicate());
NewBody->Bodyparts.add(Bodyparts[i]->Duplicate());

return &NewBody;
return NewBody;
}

int HitGroupToBodyPart(int HitGroup)
Expand Down
3 changes: 0 additions & 3 deletions src/game/server/monsters/bodyparts/bodyparts_human.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ enum
HUMAN_BODYPARTS
};

extern const char* ModelListHumanMale[HUMAN_BODYPARTS];
extern const char* ModelListHumanFemale[HUMAN_BODYPARTS];

class CHumanBodypart : public CBodypart
{
public:
Expand Down
24 changes: 1 addition & 23 deletions src/game/server/player/modeldefs.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
// YOU NEED THIS (MODEL_HUMAN_REF) for animations even though it's the
// exact same as male1.... queer the way the engine works
// exact same as male1...
#define MODEL_HUMAN_REF "models/human/reference.mdl"
//#define MODEL_DWARF_REF "models/dwarf/reference.mdl" // MIB FEB2015_21 [RACE_MENU] - Dwarf model
//#define MODEL_ELF_REF "models/elf/reference.mdl" // MIB FEB2015_21 [RACE_MENU] - Elf model

#define MODEL_HUMAN_MALE1 "models/human/male1/male1.mdl"
#define MODEL_HUMAN_HEAD "models/human/male1/head.mdl"
#define MODEL_HUMAN_CHEST "models/human/male1/body.mdl"
#define MODEL_HUMAN_ARMS "models/human/male1/arms.mdl"
#define MODEL_HUMAN_LEGS "models/human/male1/legs.mdl"

#define MODEL_HUMAN_FEMALE1 "models/human/male1/male1.mdl"
#define MODEL_HUMAN_FEM_HEAD "models/human/male1/head.mdl"
#define MODEL_HUMAN_FEM_CHEST "models/human/male1/body.mdl"
#define MODEL_HUMAN_FEM_ARMS "models/human/male1/arms.mdl"
#define MODEL_HUMAN_FEM_LEGS "models/human/male1/legs.mdl"
//#define MODEL_HUMAN_FEM_HEAD "models/human/female1/head.mdl"
//#define MODEL_HUMAN_FEM_CHEST "models/human/female1/chest.mdl"
//#define MODEL_HUMAN_FEM_ARMS "models/human/female1/arms.mdl"
//#define MODEL_HUMAN_FEM_LEGS "models/human/female1/legs.mdl"

//Dwarf
//#define MODEL_DWARF_MALE1 "models/dwarf/male1.mdl"
//#define MODEL_GHOST "models/human/man1.mdl"
2 changes: 1 addition & 1 deletion src/game/server/player/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,7 @@ void CBasePlayer::Spawn(void)
m_flFallVelocity = 0;

//Set the model later down the line.
pev->model = IdealModel();
pev->model = MAKE_STRING(MODEL_HUMAN_REF);
SET_MODEL(ENT(pev), MODEL_HUMAN_REF);

//Find a spot for the player and create a portal
Expand Down
1 change: 0 additions & 1 deletion src/game/server/player/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ class CBasePlayer : public CMSMonster
bool CreateStats();
void DeleteStats();

int IdealModel();
Vector Size(int flags = 0);
void SetSize(int flags = 0);
float Volume();
Expand Down
16 changes: 0 additions & 16 deletions src/game/server/player/playershared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ void ShowWeaponDesc(CGenericItem* pItem);
#include "game.h"
//END NOTE

const char* ModelListHumanMale[HUMAN_BODYPARTS] =
{
MODEL_HUMAN_LEGS,
MODEL_HUMAN_HEAD,
MODEL_HUMAN_CHEST,
MODEL_HUMAN_ARMS,
};

const char* ModelListHumanFemale[HUMAN_BODYPARTS] =
{
MODEL_HUMAN_FEM_LEGS,
MODEL_HUMAN_FEM_HEAD,
MODEL_HUMAN_FEM_CHEST,
MODEL_HUMAN_FEM_ARMS,
};

keysnapshot KeyHistory[MAX_KEYHISTORY];

const char* GetPlayerTitle(int Title)
Expand Down
9 changes: 0 additions & 9 deletions src/game/server/player/playerstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
#include "weapons/genericitem.h"
#include "modeldefs.h"

int CBasePlayer::IdealModel()
{
return MAKE_STRING(MODEL_HUMAN_REF);
/*if( m_Gender == GENDER_MALE )
return MAKE_STRING(MODEL_HUMAN_REF);
else return MAKE_STRING(MODEL_HUMAN_REF);*/
//return MAKE_STRING(Race->MaleModel);
//return MAKE_STRING(Race->FemaleModel);
}
Vector CBasePlayer::Size(int flags)
{
return Vector(m_Width, m_Width, (!(flags & FL_DUCKING)) ? m_Height : m_Height / 2);
Expand Down