diff --git a/Makefile b/Makefile index 31b60c20c..c688f9ff2 100644 --- a/Makefile +++ b/Makefile @@ -1183,7 +1183,6 @@ PLAYER_OBJS_ = \ src/game/common/h2vector.o \ src/game/common/h2rand.o \ src/common/shared/shared.o \ - src/game/player/library/surfaceprops.o \ src/game/player/library/p_actions.o \ src/game/player/library/p_animactor.o \ src/game/player/library/p_anim_branch.o \ diff --git a/src/game/player/client.c b/src/game/player/client.c index b2ef1f262..46c5e525b 100644 --- a/src/game/player/client.c +++ b/src/game/player/client.c @@ -3658,9 +3658,9 @@ ClientThink(edict_t *ent, usercmd_t *ucmd) client->playerinfo.velocity[2] = ent->velocity[2] = pm.velocity[2] * 0.125; // jmarshall end - client->playerinfo.GroundSurface=pm.GroundSurface; - memcpy(&client->playerinfo.GroundPlane,&pm.GroundPlane,sizeof(cplane_t)); - client->playerinfo.GroundContents=*pm.GroundContents; + client->playerinfo.GroundSurface = pm.GroundSurface; + memcpy(&client->playerinfo.GroundPlane, &pm.GroundPlane, sizeof(cplane_t)); + client->playerinfo.GroundContents =* pm.GroundContents; // If we're move-locked, don't update the edict's origin and velocity, otherwise copy the // origin and velocity from playerinfo (which have been written by Pmove()) into the edict's diff --git a/src/game/player/library/p_actions.c b/src/game/player/library/p_actions.c index 06e7bf0cc..ff90defab 100644 --- a/src/game/player/library/p_actions.c +++ b/src/game/player/library/p_actions.c @@ -14,7 +14,6 @@ #include "p_weapon.h" #include "p_weapon.h" #include "../../header/g_items.h" -#include "surfaceprops.h" #include "../../monster/misc/player.h" #include "../../common/fx.h" #include "../../common/h2rand.h" @@ -1465,6 +1464,20 @@ void PlayerActionBowTrailEnd(playerinfo_t *playerinfo, float value) playerinfo->effects &= ~EF_TRAILS_ENABLED; } +const char * +GetClientGroundSurfaceMaterialName(playerinfo_t *playerinfo) +{ + csurface_t *groundSurface; + + groundSurface = playerinfo->GroundSurface; + if (groundSurface && groundSurface->material[0]) + { + return groundSurface->material; + } + + return NULL; +} + /*----------------------------------------------- PlayerActionFootstep -----------------------------------------------*/ @@ -1513,9 +1526,9 @@ void PlayerActionFootstep(playerinfo_t *playerinfo, float value) } else { - char *material; + const char *material; - material=GetClientGroundSurfaceMaterialName(playerinfo); + material = GetClientGroundSurfaceMaterialName(playerinfo); if (!material) return; @@ -2896,12 +2909,14 @@ void PlayerActionIdleSound(playerinfo_t *playerinfo, float value) void PlayerActionVaultSound(playerinfo_t *playerinfo, float value) { char VaultSound[64]; - char *Material=NULL; + char *Material = NULL; - Material=GetClientGroundSurfaceMaterialName(playerinfo); + Material = GetClientGroundSurfaceMaterialName(playerinfo); if(!Material) + { return; + } strcpy(VaultSound,"player/"); strcat(VaultSound, Material); diff --git a/src/game/player/library/p_ctrl.c b/src/game/player/library/p_ctrl.c index 10adbcbd8..80159ce7f 100644 --- a/src/game/player/library/p_ctrl.c +++ b/src/game/player/library/p_ctrl.c @@ -11,7 +11,6 @@ #include "p_anims.h" #include "p_ctrl.h" #include "p_main.h" -#include "surfaceprops.h" #include "../../common/h2rand.h" #include "../../common/fx.h" @@ -243,7 +242,7 @@ void PlayerIntLand(playerinfo_t *playerinfo, float landspeed) // Don't do dust in the water! - if(playerinfo->waterlevel==0) + if(playerinfo->waterlevel == 0) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID15, playerinfo->G_GetEntityStatePtr(playerinfo->self), diff --git a/src/game/player/library/player.h b/src/game/player/library/player.h index b31457c1d..891c2f199 100644 --- a/src/game/player/library/player.h +++ b/src/game/player/library/player.h @@ -177,5 +177,6 @@ void Weapon_EquipBow(playerinfo_t* playerinfo, gitem_t* Weapon); void Weapon_EquipArmor(playerinfo_t* playerinfo, gitem_t* Weapon); int Weapon_CurrentShotsLeft(playerinfo_t* playerinfo); int Defence_CurrentShotsLeft(playerinfo_t* playerinfo, int intent); +const char *GetClientGroundSurfaceMaterialName(playerinfo_t *playerinfo); #endif // PLAYER_H diff --git a/src/game/player/library/surfaceprops.c b/src/game/player/library/surfaceprops.c deleted file mode 100644 index aa26ad375..000000000 --- a/src/game/player/library/surfaceprops.c +++ /dev/null @@ -1,29 +0,0 @@ -// -// Heretic II -// Copyright 1998 Raven Software -// -#include "surfaceprops.h" - -char *GetClientGroundSurfaceMaterialName(playerinfo_t *playerinfo) -{ -#if 1 - return NULL; -#else - /* TODO: Rewrite Ground is not set so disable it for now */ - csurface_t *groundSurface; - char *result = NULL; - - groundSurface = playerinfo->GroundSurface; // jmarshall - check this. - if (groundSurface) - { - const char *surfacePropNames[] = { - "gravel", - "metal", - "stone", - "wood", - } - result = surfacePropNames[(groundSurface->value >> 24) % 4]; - } - return result; -#endif -} diff --git a/src/game/player/library/surfaceprops.h b/src/game/player/library/surfaceprops.h deleted file mode 100644 index fbc3a50ea..000000000 --- a/src/game/player/library/surfaceprops.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// surfaceprops.h -// -// Heretic II -// Copyright 1998 Raven Software -// - -#ifndef _SURFACEPROPS_H_ -#define _SURFACEPROPS_H_ - -#include "player.h" - -#define MAX_SURFACE_MAT_NAMES 256 - -extern char *SurfaceMaterialNames[MAX_SURFACE_MAT_NAMES]; - -extern char *GetClientGroundSurfaceMaterialName(playerinfo_t *playerinfo); - -#endif // _SURFACEPROPS_H_