Skip to content

Commit 9e2a36b

Browse files
committed
Fixed a possible crash
1 parent 168418c commit 9e2a36b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/core/modules/engine/engine1/engine_wrap_python.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ inline void IEngineSound_EmitSound(IEngineSound* pEngineSound, IRecipientFilter&
7474
float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, const Vector *pOrigin = NULL, const Vector *pDirection = NULL,
7575
tuple origins = tuple(), bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1)
7676
{
77-
CUtlVector< Vector >* pUtlVecOrigins = NULL;
77+
CUtlVector< Vector > pUtlVecOrigins = NULL;
7878
for(int i=0; i < len(origins); i++)
7979
{
80-
pUtlVecOrigins->AddToTail(extract<Vector>(origins[i]));
80+
pUtlVecOrigins.AddToTail(extract<Vector>(origins[i]));
8181
}
8282

83-
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, flVolume, flAttenuation, iFlags, iPitch, 0, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
83+
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, flVolume, flAttenuation, iFlags, iPitch, 0, pOrigin, pDirection, &pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
8484
}
8585

8686
template<class T>

src/core/modules/engine/engine3/engine_wrap_python.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ inline void IEngineSound_EmitSound(IEngineSound* pEngineSound, IRecipientFilter&
253253
float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, const Vector *pOrigin = NULL, const Vector *pDirection = NULL,
254254
tuple origins = tuple(), bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1)
255255
{
256-
CUtlVector< Vector >* pUtlVecOrigins = NULL;
256+
CUtlVector< Vector > pUtlVecOrigins = NULL;
257257
for(int i=0; i < len(origins); i++)
258258
{
259-
pUtlVecOrigins->AddToTail(extract<Vector>(origins[i]));
259+
pUtlVecOrigins.AddToTail(extract<Vector>(origins[i]));
260260
}
261261

262-
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, -1, pSample, flVolume, flAttenuation, 0, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
262+
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, -1, pSample, flVolume, flAttenuation, 0, iFlags, iPitch, pOrigin, pDirection, &pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
263263
}
264264

265265
template<class T>

0 commit comments

Comments
 (0)