Print texture type along with texture name when using impulse 107, make PM_FindTextureType const correct

This commit is contained in:
Sam V 2023-02-02 17:24:12 +01:00
parent 3706fdda66
commit 2f29611676
5 changed files with 6 additions and 4 deletions

View file

@ -22,6 +22,8 @@
* Save and restore game_player_equip [#188](https://github.com/SamVanheer/halflife-updated/issues/188)
* Moved IsFacing function from barney.cpp to h_ai.cpp to help prevent linker errors when copy pasting source file
* When using `impulse 107` to get the name of a texture the texture type (as used in `materials.txt`) will also be printed
* Made `PM_FindTextureType` const correct
## Changes in V1.0.0 Beta 013

View file

@ -3563,7 +3563,7 @@ void CBasePlayer::CheatImpulseCommands(int iImpulse)
pWorld = tr.pHit;
const char* pTextureName = TRACE_TEXTURE(pWorld, start, end);
if (pTextureName)
ALERT(at_console, "Texture: %s\n", pTextureName);
ALERT(at_console, "Texture: %s (%c)\n", pTextureName, PM_FindTextureType(pTextureName));
}
break;
case 195: // show shortest paths for entire level to nearest node

View file

@ -455,7 +455,7 @@ typedef struct
void (*pfnPM_Move)(struct playermove_s* ppmove, qboolean server);
void (*pfnPM_Init)(struct playermove_s* ppmove);
char (*pfnPM_FindTextureType)(char* name);
char (*pfnPM_FindTextureType)(const char* name);
void (*pfnSetupVisibility)(struct edict_s* pViewEntity, struct edict_s* pClient, unsigned char** pvs, unsigned char** pas);
void (*pfnUpdateClientData)(const struct edict_s* ent, int sendweapons, struct clientdata_s* cd);
int (*pfnAddToFullPack)(struct entity_state_s* state, int e, edict_t* ent, edict_t* host, int hostflags, int player, unsigned char* pSet);

View file

@ -264,7 +264,7 @@ void PM_InitTextureTypes()
bTextureTypeInit = true;
}
char PM_FindTextureType(char* name)
char PM_FindTextureType(const char* name)
{
int left, right, pivot;
int val;

View file

@ -25,7 +25,7 @@ struct playermove_s;
void PM_Init(playermove_s* ppmove);
void PM_Move(playermove_s* ppmove, qboolean server);
char PM_FindTextureType(char* name);
char PM_FindTextureType(const char* name);
/**
* @brief Engine calls this to enumerate player collision hulls, for prediction. Return false if the hullnumber doesn't exist.