source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

[HL2MP] MP gravity gun carried objects fix

Open speedvoltage opened this issue 9 months ago • 0 comments

Original fix applied by Tony Sergi here.

Original commit comment:

Fix MP Gravity Gun carried objects This is a fix that myself and Mike Durand had applied to the 2007 SDK, that overcomes the UTIL_GetLocalPlayer (single player only) calls for physgun carried objects in multiplayer. This allows Gravity Gun thrown objects to have their physics mass calculated correctly in multiplayer.

Issue: In multiplayer mode, the physcannon was not calculating the physics mass of objects that were carried or thrown properly. This was due to the reliance on UTIL_GetLocalPlayer(), which only works well in single-player scenarios. As a result, items tossed in multiplayer can behave in unexpected ways.

Fix: Replace UTIL_GetLocalPlayer() with a method that’s compatible with multiplayer. This change makes sure that the physics mass of objects thrown with the physcannon is calculated properly. Now, when you use the physcannon in multiplayer, the objects you carry will act as expected, resulting in smooth and dependable interactions.

speedvoltage avatar Mar 14 '25 21:03 speedvoltage