Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMC & Ricochet - Memory access violation in Debug & mouse issues in Release #1622

Open
JoelTroch opened this issue May 25, 2015 · 4 comments

Comments

@JoelTroch
Copy link
Contributor

Deathmatch Classic and Ricochet's source codes have problems.

This is what I have done :

  1. Cloned the master branch of this repository.
  2. Opened projects.sln in Visual Studio 2010.
  3. Built the solution (no errors but warnings).
  4. Disabled in DMC, HL & Ricochet's projects the warnings C4018 ('<' signed/unsigned mismatch), C4258 ('X' : definition from the for loop is ignored; the definition from the enclosing scope is used) and C4996 ('_X': This function or variable may be unsafe. Consider using '_X_s' instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.).
  5. Cleaned the solution.
  6. Built the solution again (no errors & no warnings).
  7. Copied and pasted both dmc and ricochet game folders in my Half-Life folder.
  8. Renamed my copied "dmc" as dmcmod and my copied ricochet as ricochetmod.
  9. Tweaked the game key of liblist.gam of dmcmod & ricochetmod, Steam now shows me Deathmatch Classic (Mod source code) & Ricochet (Mod source code).
  10. Placed the compiled DLLs in their appropriate folders (dmc.dll into dmcmod\dlls, mp.dll into ricochetmod\dlls, etc...)
  11. Started the mod through Steam.
  12. "Create Server" --> "Start game"

And here are the results :
DMC & Ricochet Debug : crash at "Starting local game server...", WinDBG tells me there is a memory access violation at line 1509 in dlls/sound.cpp (if ( pMemFile[i] == '\n' ))
DMC & Ricochet Release : working but has issue #1546 except that it also happens when m_rawinput is 0

@dtugend
Copy link
Contributor

dtugend commented May 29, 2015

I cannot comment on the crash atm, since I did not look enough into that yet.

Regarding the mouse issues:
DMC & Ricochet client DLLs don't support the m_rawinput cvar, the input is always raw, as you can see in their inputw32.cpp. The bug with the mouse being trapped in the window rectangle has been fixed in pull request #1559 which has not been accepted so far though.

@dtugend
Copy link
Contributor

dtugend commented May 29, 2015

Hello.

Apparently the crash is a mistake in the code that has been fixed for Half-Life but not for DMC and Ricochet:
filePos is not initialized to 0 for DMC and Ricochet, while it is for Half-Life.

Question is if you want to make a pull request fixing it or if I should?
I really don't care who does, if you have fun fixing it, then go for it.

However this re-raises a serious question that I already raised in issue #1557 - Is the code for DMC and ricochet really the code they used for their Steam builds, or did they check a wrong (old) version into github????!!!!

@JoelTroch
Copy link
Contributor Author

Since you found the fix, I let you the honor to make the PR ^_^

I asked WinMerge to compare DMC 2.3 and DMC GitHub source codes, the report is there

However, the only differences I've found out so far are:

  • New defines that aren't used

  • Added/removed empty EOL

  • The "Threewave" game mode (a sort of CTF with grappling hook)

  • Pointer fixes SetThink( MyMethod ); --> SetThink( &CMyClass::MyMethod );

  • Some C4258 warning fixes for ( int i = 0; i < something; i++ ) -->

    int i;
    for ( i = 0, i < something; i++ )

dtugend added a commit to advancedfx/halflife that referenced this issue May 29, 2015
Fixes crashes in sound.cpp for dmc and ricochet mods.
@dtugend
Copy link
Contributor

dtugend commented May 29, 2015

Ok, thank you, done :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants