Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed EngineSound.emit_sound from crashing on OrangeBox engine.
- Loading branch information
invincibleqc
committed
Jun 11, 2014
1 parent
d09384f
commit 03d9e12
Showing
1 changed file
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
03d9e12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test code:
03d9e12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't fix the real issue. The problem is that pUtlVecOrigins is never initialized. Also, the length check is not necessary. :P
Actually, it should also crash on CS:GO.
03d9e12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't AddToTail supposed to grow itself? And the length check is necessary as we want to explicitly pass NULL unless we have valid data.
However, the following seems to work just fine:
While using the following code:
03d9e12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that should work. The reason why your previous code would crash in the loop is because it would try to call AddToTail() on a NULL pointer and member variables are used in that call.