Little code cleaning: g_vecAttackDir (#831)

* Tiny code cleaning

* Skip REGAMEDLL_FIXES

* UTIL_BloodDrips: remove useless `direction` param

* Fix test demo (RANDOM_FLOAT inside UTIL_RandomBloodVector should be called for testdemo)

---------

Co-authored-by: Sergey Shorokhov <wopox1337@ya.ru>
Co-authored-by: s1lentq <s1lentsk@yandex.ru>
This commit is contained in:
Francisco Muñoz 2023-07-10 20:01:53 -04:00 committed by GitHub
parent a5f288fbd6
commit 6375ea5504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 6 deletions

View File

@ -1737,10 +1737,12 @@ Vector CBlood::BloodPosition(CBaseEntity *pActivator)
void CBlood::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
const Vector direction = Direction();
if (pev->spawnflags & SF_BLOOD_STREAM)
UTIL_BloodStream(BloodPosition(pActivator), Direction(), (Color() == BLOOD_COLOR_RED) ? 70 : Color(), int(BloodAmount()));
UTIL_BloodStream(BloodPosition(pActivator), direction, (Color() == BLOOD_COLOR_RED) ? 70 : Color(), int(BloodAmount()));
else
UTIL_BloodDrips(BloodPosition(pActivator), Direction(), Color(), int(BloodAmount()));
UTIL_BloodDrips(BloodPosition(pActivator), Color(), int(BloodAmount()));
if (pev->spawnflags & SF_BLOOD_DECAL)
{

View File

@ -6596,7 +6596,7 @@ void CBasePlayer::CheatImpulseCommands(int iImpulse)
TraceResult tr;
Vector dir(0, 0, 1);
UTIL_BloodDrips(pev->origin, dir, BLOOD_COLOR_RED, 2000);
UTIL_BloodDrips(pev->origin, BLOOD_COLOR_RED, 2000);
for (int r = 1; r < 4; r++)
{

View File

@ -1056,7 +1056,7 @@ void UTIL_BloodStream(const Vector &origin, const Vector &direction, int color,
MESSAGE_END();
}
void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, int amount)
void UTIL_BloodDrips(const Vector &origin, int color, int amount)
{
if (!UTIL_ShouldShowBlood(color))
return;

View File

@ -262,7 +262,7 @@ bool UTIL_IsMasterTriggered(string_t sMaster, CBaseEntity *pActivator);
BOOL UTIL_ShouldShowBlood(int color);
int UTIL_PointContents(const Vector &vec);
void UTIL_BloodStream(const Vector &origin, const Vector &direction, int color, int amount);
void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, int amount);
void UTIL_BloodDrips(const Vector &origin, int color, int amount);
Vector UTIL_RandomBloodVector();
void UTIL_BloodDecalTrace(TraceResult *pTrace, int bloodColor);
void UTIL_DecalTrace(TraceResult *pTrace, int decalNumber);

View File

@ -112,7 +112,7 @@ void AddMultiDamage(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamag
void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage)
{
UTIL_BloodDrips(vecSpot, g_vecAttackDir, bloodColor, int(flDamage));
UTIL_BloodDrips(vecSpot, bloodColor, int(flDamage));
}
NOXREF int DamageDecal(CBaseEntity *pEntity, int bitsDamageType)