Skip to content

Commit 6375ea5

Browse files
dystopmwopox1337s1lentq
authored
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>
1 parent a5f288f commit 6375ea5

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

regamedll/dlls/effects.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,10 +1737,12 @@ Vector CBlood::BloodPosition(CBaseEntity *pActivator)
17371737

17381738
void CBlood::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
17391739
{
1740+
const Vector direction = Direction();
1741+
17401742
if (pev->spawnflags & SF_BLOOD_STREAM)
1741-
UTIL_BloodStream(BloodPosition(pActivator), Direction(), (Color() == BLOOD_COLOR_RED) ? 70 : Color(), int(BloodAmount()));
1743+
UTIL_BloodStream(BloodPosition(pActivator), direction, (Color() == BLOOD_COLOR_RED) ? 70 : Color(), int(BloodAmount()));
17421744
else
1743-
UTIL_BloodDrips(BloodPosition(pActivator), Direction(), Color(), int(BloodAmount()));
1745+
UTIL_BloodDrips(BloodPosition(pActivator), Color(), int(BloodAmount()));
17441746

17451747
if (pev->spawnflags & SF_BLOOD_DECAL)
17461748
{

regamedll/dlls/player.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6596,7 +6596,7 @@ void CBasePlayer::CheatImpulseCommands(int iImpulse)
65966596
TraceResult tr;
65976597
Vector dir(0, 0, 1);
65986598

6599-
UTIL_BloodDrips(pev->origin, dir, BLOOD_COLOR_RED, 2000);
6599+
UTIL_BloodDrips(pev->origin, BLOOD_COLOR_RED, 2000);
66006600

66016601
for (int r = 1; r < 4; r++)
66026602
{

regamedll/dlls/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ void UTIL_BloodStream(const Vector &origin, const Vector &direction, int color,
10561056
MESSAGE_END();
10571057
}
10581058

1059-
void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, int amount)
1059+
void UTIL_BloodDrips(const Vector &origin, int color, int amount)
10601060
{
10611061
if (!UTIL_ShouldShowBlood(color))
10621062
return;

regamedll/dlls/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ bool UTIL_IsMasterTriggered(string_t sMaster, CBaseEntity *pActivator);
262262
BOOL UTIL_ShouldShowBlood(int color);
263263
int UTIL_PointContents(const Vector &vec);
264264
void UTIL_BloodStream(const Vector &origin, const Vector &direction, int color, int amount);
265-
void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, int amount);
265+
void UTIL_BloodDrips(const Vector &origin, int color, int amount);
266266
Vector UTIL_RandomBloodVector();
267267
void UTIL_BloodDecalTrace(TraceResult *pTrace, int bloodColor);
268268
void UTIL_DecalTrace(TraceResult *pTrace, int decalNumber);

regamedll/dlls/weapons.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void AddMultiDamage(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamag
112112

113113
void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage)
114114
{
115-
UTIL_BloodDrips(vecSpot, g_vecAttackDir, bloodColor, int(flDamage));
115+
UTIL_BloodDrips(vecSpot, bloodColor, int(flDamage));
116116
}
117117

118118
NOXREF int DamageDecal(CBaseEntity *pEntity, int bitsDamageType)

0 commit comments

Comments
 (0)