Halflife: Game crash when viewing demo files

Created on 12 Oct 2019  路  19Comments  路  Source: ValveSoftware/halflife

The game can crash when you try to play dem files using the playdemo and viewdemo commands. A crash occurs when the scoreboard is displayed on the screen. Apparently, a crash occurs only when viewing dems that were recorded on game servers with an outdated build.

Having analyzed the problem, I found that when viewing dems recorded on newest game build, the function CCSClientScoreBoardDialog::InitScoreboardSections is called, while for older versions, the function execution does not occur. For this reason, such variables as CCSClientScoreBoardDialog::m_pShortHeaders are not initialized, which leads to crash.

The crash itself was found in the CCSClientScoreBoardDialog::UpdateHeaders function when trying to get the value of the CCSClientScoreBoardDialog::m_pShortHeaders variable at the beginning of the function. Since this variable is not initialized, we get a pointer to 0 instead of correct cvar_t pointer.

Apparently, the crash occurs due to the fact that the problematic dem files do not contain UserMsg call - InitHUD, which performs the necessary initializations when starting the dem view. Demos that do not crash contain this call.

I believe that this problem has existed for a very long time, but due to recent innovations, it began to manifest itself in the form of a game crash. Earlier, I often noticed that the opening scoreboard when viewing old demos looked distorted - it lacked a list of players and any other data:

image

I think that HUD initialization, bypassing UserMsg, is appropriate if we playing the dem file. This would fix two problems at once - scoreboard distortion and crash of the game when viewing old dem files.

Most helpful comment

Hi all, this should be fixed now in the current beta. Based on the suggestion from @2010kohtep I added an InitHUD message that is artificially sent when starting a demo through viewdemo or playdemo.

All 19 comments

@mikela-valve priority bugfix.

Finally, we will see the scoreboard well at demos.

If you connect to a server and watch the demo it'll work correctly.

@mikela-valve

https://volafile.org/r/11w8xdgt8 - demo example

Please review this asap

Yes I noticed that too

"There has been a problem since the last update

when i try watch demo viewdemo/playdemo

after few sec game crash
this happens in most of the files I try to see

i check if the problem with file , i try download counter strike non steam
and its work fine excluding few things like voice player , scoreboard..

so its problem with new update"

i hope valve fix that with update or publish file fix that.

For anybody in a hurry, here are previous executables for Windows:
<Link removed by moderator>
Always check the signatures before using executable files from unknown source.

For anybody in a hurry, here are previous executables for Windows:
<Link removed by moderator>
Always check the signatures before using executable files from unknown source.

im dont understand what i need to do with files....

Hello @satnatantas, the link you posted is legally problematic and has been removed.

Hello @satnatantas, the link you posted is legally problematic and has been removed.

i hope valve posted file / update fix that problem
its very important for own servevrs

For anybody in a hurry, here are previous executables for Windows:
<Link removed by moderator>
Always check the signatures before using executable files from unknown source.

You can just connect to a server and then watch the demo, no need to modify any files untill is fixed.

@Maxi605 oh, I see it now. The files I posted are from previous update when no such bug existed.

@Maxi605 oh, I see it now. The files I posted are from previous update when no such bug existed.

The bug was always there.
Difference is that now is causing a crash.

Hi all, this should be fixed now in the current beta. Based on the suggestion from @2010kohtep I added an InitHUD message that is artificially sent when starting a demo through viewdemo or playdemo.

Hi all, this should be fixed now in the current beta. Based on the suggestion from @2010kohtep I added an InitHUD message that is artificially sent when starting a demo through viewdemo or playdemo.

so only on beta version its ok ?
when u fix that on normal ?

its matter ? if im use beta or not ?

@talnaim2323 I'll be updating the public version soon with this and other fixes from https://github.com/ValveSoftware/halflife/milestone/37. I'm just waiting for some additional information on another issue to determine if there are any other changes going into it.

@talnaim2323 I'll be updating the public version soon with this and other fixes from https://github.com/ValveSoftware/halflife/milestone/37. I'm just waiting for some additional information on another issue to determine if there are any other changes going into it.

oh ok i understand u , so when u take all probelm and fix them
u update in public version

nice and ty for fast answer xD

if i found problems i post here

i hope u fix rates / shooting
i remmber before update of 2017
The shooting was better and more accurate

Closing as fixed.

Hi. The viewdemo still not work in Condition Zero.

Just call mikela thru @

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BlackShadow picture BlackShadow  路  3Comments

twisterniq picture twisterniq  路  4Comments

metita picture metita  路  3Comments

WhiteFang1319 picture WhiteFang1319  路  3Comments

BlackShadow picture BlackShadow  路  3Comments