Thanks Mark.  I will give that a try.

-----Original Message-----
From: Mark Chandler <[EMAIL PROTECTED]>
Sent: Sunday, February 03, 2008 8:20 AM
To: [email protected]
Subject: RE: [hlcoders] Weapon Prediction Problems?

http://list.valvesoftware.com/mailman/private/hlcoders/2007-September/022161
.html


Quote
I'm glad you brought this topic back up, and I've found the definite
fix.  The original problem was that weapons would shoot too fast, but
I've been encountering a problem where weapon animations are just plain
glitchy when not at a sub 50 ping.  Both of these problems are only
evident in the base SDK and not the HL2 DM SDK.  Your moving the
m_flNextPrimaryAttack variable into the player is an interesting hint at
the real source of the problem, but the problem is not due to anything
about how networked data is updated or received.  The problem is that no
weapons are being predicted!

If you put "cl_predictionlist" in the console, it will print a list of
all entities in the world that are being predicted.  If you run in HL2
DM, the list is something along the lines of player, view model, and
player weapons.  However, if you look at the list in a base SDK mod,
only the player and view model are listed.  That's because your weapons
aren't being predicted.  The reason they're not predicted is because
CWeaponSDKBase does not override C_BaseEntity's ShouldPredict() function
to tell the game to predict the weapons.  In the HL2 DM sdk, the weapons
are derived from CWeaponHL2MPBase which overrides ShouldPredict() and
returning true if the local player is the one holding the weapon.


How to fix this bug:

In weapon_sdkbase.h, add:

#ifdef CLIENT_DLL
        virtual bool ShouldPredict();
#endif

In weapon_sdkbase.cpp, add:

#ifdef CLIENT_DLL
bool CWeaponSDKBase::ShouldPredict()
{
        if ( GetOwner() && GetOwner() == C_BasePlayer::GetLocalPlayer())
                return true;

        return BaseClass::ShouldPredict();
}
#endif


Credit Goes to Justin Krenz

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rodrigo
'r2d2rigo' Diaz
Sent: Sunday, February 03, 2008 8:37 PM
To: [email protected]
Subject: Re: [hlcoders] Weapon Prediction Pro

[The entire original message is not included]

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to