SDK Known Issues List: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added link to array article.)
(add "Issue" text identifiers)
Line 1: Line 1:
=This page contains the list of current known issues in the SDK=
=This page contains the list of current known issues in the SDK=


Server: weapon_citizensuitcase Assert on startup  
'''Issue:''' Server: weapon_citizensuitcase Assert on startup  


'''Workaround:''' Install copy of the SP SDK, then copy the scripts/ directory over  
'''Workaround:''' Install copy of the SP SDK, then copy the scripts/ directory over  
Line 7: Line 7:
----
----


Server: Some bullet weapons set to do 0 damage.  
'''Issue:''' Server: Some bullet weapons set to do 0 damage.  


'''Workaround:''' Need to edit their AddAmmoType which are strangely set to 0 for some reason.  
'''Workaround:''' Need to edit their AddAmmoType which are strangely set to 0 for some reason.  
Line 13: Line 13:
----
----


Server: Some projectile weapons set to do 0 damage.  
'''Issue:''' Server: Some projectile weapons set to do 0 damage.  


'''Workaround:''' Need to edit their source files and set a damage.  
'''Workaround:''' Need to edit their source files and set a damage.  
Line 19: Line 19:
----
----


Client: --- Missing Vgui material vgui/steam/games/icon_cz  
'''Issue:''' Client: --- Missing Vgui material vgui/steam/games/icon_cz  


'''Workaround:''' Manually extract files from GCF and copy them into your mod directory? Haven't tried this. There must be a better way.  
'''Workaround:''' Manually extract files from GCF and copy them into your mod directory? Haven't tried this. There must be a better way.  
Line 25: Line 25:
----
----


Server: The crossbow causes an assertion failure.  
'''Issue:''' Server: The crossbow causes an assertion failure.  


'''Workaround:''' Comment out ai_activity.cpp line 53. This doesn't appear to be something that can be fixed in code?  
'''Workaround:''' Comment out ai_activity.cpp line 53. This doesn't appear to be something that can be fixed in code?  
Line 31: Line 31:
----
----


Server? Client?: RL explosion invisible, per http://www.chatbear.com/board.plm?a=viewthread&t=970,1107153392,30132&id=786504&b=4991&v=flatold  
'''Issue:''' Server? Client?: RL explosion invisible, per http://www.chatbear.com/board.plm?a=viewthread&t=970,1107153392,30132&id=786504&b=4991&v=flatold  


'''Workaround:''' No known workaround.  
'''Workaround:''' No known workaround.  
Line 37: Line 37:
----
----


util.cpp (531) : Assertion Failed: !"UTIL_GetLocalPlayer"  
'''Issue:''' util.cpp (531) : Assertion Failed: !"UTIL_GetLocalPlayer"  
 
Occurs when taking damage to yourself from tossing a table straight up into the air.  
Occurs when taking damage to yourself from tossing a table straight up into the air. The following patch fixes the Assert, and appears to be more functionally correct as well. Validation from Valve that the patch is correct would be appreciated.


'''Workaround:'''
'''Workaround:'''
The following patch fixes the Assert, and appears to be more functionally correct as well. Validation from Valve that the patch is correct would be appreciated.
<pre>
<pre>
Index: mod/src/dlls/player.h
Index: mod/src/dlls/player.h
Line 103: Line 103:
----
----


Assert !"UTIL_GetLocalPlayer" when using combine ball  
'''Issue:''' Assert !"UTIL_GetLocalPlayer" when using combine ball  


'''Workaround:'''
'''Workaround:'''
Line 125: Line 125:
----
----


CreateEvent: event 'break_prop' not registered  
'''Issue:''' CreateEvent: event 'break_prop' not registered  


'''Workaround:''' Significance and fix both unknown  
'''Workaround:''' Significance and fix both unknown  
Line 131: Line 131:
----
----


HL2.exe mysteriously segfaults if you forget to put the client.dll and server.dll in your mod's bin directory  
'''Issue:''' HL2.exe mysteriously segfaults if you forget to put the client.dll and server.dll in your mod's bin directory  


'''Workaround:''' Don't do that.  
'''Workaround:''' Don't do that.  
Line 137: Line 137:
----
----


If you leave a server online on a certain map for roughly 12-24 hours straight, it begins using 100% CPU.  Possibly a core srcds.exe bug, not an SDK bug?  
'''Issue:''' If you leave a server online on a certain map for roughly 12-24 hours straight, it begins using 100% CPU.  Possibly a core srcds.exe bug, not an SDK bug?  


I suppose there could be some [[array]] or something inside the HL2 core that grows over time, and must be iterated over each frame?
I suppose there could be some [[array]] or something inside the HL2 core that grows over time, and must be iterated over each frame?
Line 149: Line 149:
----
----


Negative entitygroundcontact crash. The implications of this SDK bug are not at all clear, but in debug mode you'll get an assert, and in release mode it will presumably segfault.  Update: count < 0 isn't enough - I've changed it to also check > 128 or so.
'''Issue:''' Negative entitygroundcontact crash. The implications of this SDK bug are not at all clear, but in debug mode you'll get an assert, and in release mode it will presumably segfault.  Update: count < 0 isn't enough - I've changed it to also check > 128 or so.


'''Workaround:'''
'''Workaround:'''
Line 174: Line 174:
----
----


Doing a 360 quickly with the Stun Baton as your active weapon causes the screen to flash white  
'''Issue:''' Doing a 360 quickly with the Stun Baton as your active weapon causes the screen to flash white  


'''Workaround:''' Fix unknown
'''Workaround:''' Fix unknown
Line 180: Line 180:
----
----


Assert on line 866 of mod/src/game_shared/basecombatweapon_shared.cpp  
'''Issue:''' Assert on line 866 of mod/src/game_shared/basecombatweapon_shared.cpp  


'''Workaround:''' I haven't been able to determine exactly why this is an assert. It's just "Assert(0);" with no accompanying explanation, but commenting it out results in no problems it seems.  
'''Workaround:''' I haven't been able to determine exactly why this is an assert. It's just "Assert(0);" with no accompanying explanation, but commenting it out results in no problems it seems.  


[[Category:Debugging]] [[Category:Developer Issues and Workarounds]] [[Category:Programming]] [[Category:Source SDK FAQ]]
[[Category:Debugging]] [[Category:Developer Issues and Workarounds]] [[Category:Programming]] [[Category:Source SDK FAQ]]

Revision as of 13:02, 16 July 2005

This page contains the list of current known issues in the SDK

Issue: Server: weapon_citizensuitcase Assert on startup

Workaround: Install copy of the SP SDK, then copy the scripts/ directory over


Issue: Server: Some bullet weapons set to do 0 damage.

Workaround: Need to edit their AddAmmoType which are strangely set to 0 for some reason.


Issue: Server: Some projectile weapons set to do 0 damage.

Workaround: Need to edit their source files and set a damage.


Issue: Client: --- Missing Vgui material vgui/steam/games/icon_cz

Workaround: Manually extract files from GCF and copy them into your mod directory? Haven't tried this. There must be a better way.


Issue: Server: The crossbow causes an assertion failure.

Workaround: Comment out ai_activity.cpp line 53. This doesn't appear to be something that can be fixed in code?


Issue: Server? Client?: RL explosion invisible, per http://www.chatbear.com/board.plm?a=viewthread&t=970,1107153392,30132&id=786504&b=4991&v=flatold

Workaround: No known workaround.


Issue: util.cpp (531) : Assertion Failed: !"UTIL_GetLocalPlayer" Occurs when taking damage to yourself from tossing a table straight up into the air.

Workaround: The following patch fixes the Assert, and appears to be more functionally correct as well. Validation from Valve that the patch is correct would be appreciated.

Index: mod/src/dlls/player.h
===================================================================
--- mod/src/dlls/player.h 2005/02/19 22:20:29 1.2
+++ mod/src/dlls/player.h 2005/02/24 00:35:30
@@ -459,6 +459,7 @@
     // mass/size limit set to zero for none
     static bool CanPickupObject( CBaseEntity *pObject, float massLimit, float sizeLimit );
     virtual void PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize = true ) {}
+    virtual bool IsHoldingEntity( CBaseEntity *pEnt );
     virtual void ForceDropOfCarriedPhysObjects( CBaseEntity *pOnlyIfHoldindThis = NULL ) {}
     virtual float GetHeldObjectMass( IPhysicsObject *pHeldObject );

Index: mod/src/dlls/player.cpp
===================================================================
--- mod/src/dlls/player.cpp 2005/02/21 00:05:42 1.3
+++ mod/src/dlls/player.cpp 2005/02/24 00:35:33
@@ -7447,3 +7447,7 @@
     return cmd;
 }

+bool CBasePlayer::IsHoldingEntity( CBaseEntity *pEnt )
+{
+    return PlayerPickupControllerIsHoldingEntity( m_hUseEntity, pEnt );
+}

Index: mod/src/dlls/physics_impact_damage.cpp
===================================================================
--- mod/src/dlls/physics_impact_damage.cpp 2005/02/18 04:45:50 1.1.1.1
+++ mod/src/dlls/physics_impact_damage.cpp 2005/02/24 00:42:24
@@ -417,12 +417,22 @@
     else if ( pEvent->pObjects[index>GetGameFlags() & FVPHYSICS_PLAYER_HELD )
     {
     // if the player is holding the object, use it's real mass (player holding reduced the mass)
-    CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
-    if ( pPlayer )
-    {
+    CBasePlayer* pPlayer = NULL;
+    {for (int i = 1; i <= gpGlobals->maxClients; i++) {
+        CBasePlayer *temp_player = UTIL_PlayerByIndex(i);
+        if (temp_player
+            && temp_player->edict()
+            && temp_player->IsHoldingEntity(pEvent->pEntities[index])
+        ) {
+            pPlayer = temp_player;
+            break;
+        }
+    }}
+    Assert(pPlayer && "object with FVPHYSICS_PLAYER_HELD but no player holding it");
+    if (pPlayer) {
     float mass = pPlayer->GetHeldObjectMass( pEvent->pObjects[index] );
-    if ( mass > 0 )
-    {
+        Assert((mass > 0) && "player was holding object so mass should be non-zero");
+        if (mass > 0) {
             invMass = 1.0f / mass;
         }
     }

Issue: Assert !"UTIL_GetLocalPlayer" when using combine ball

Workaround:

diff -u -r1.1.1.1 prop_combine_ball.cpp 
--- mod/src/dlls/hl2_dll/prop_combine_ball.cpp 2005/02/18 04:45:52 1.1.1.1 
+++ mod/src/dlls/hl2_dll/prop_combine_ball.cpp 2005/02/24 01:34:21 
@@ -788,9 +788,9 @@ 
     pPhysicsObject->GetPosition( &vecPosition, NULL ); 
     pPhysicsObject->GetVelocity( &vecVelocity, NULL ); 

-    CBasePlayer *pPlayer = UTIL_GetLocalPlayer(); 
-    if ( pPlayer ) 
+    if (gpGlobals->maxClients == 1) 
     { 
+    CBasePlayer *pPlayer = UTIL_GetLocalPlayer(); 
     Vector vecDelta; 
     VectorSubtract( pPlayer->GetAbsOrigin(), vecPosition, vecDelta ); 
     VectorNormalize( vecDelta );

Issue: CreateEvent: event 'break_prop' not registered

Workaround: Significance and fix both unknown


Issue: HL2.exe mysteriously segfaults if you forget to put the client.dll and server.dll in your mod's bin directory

Workaround: Don't do that.


Issue: If you leave a server online on a certain map for roughly 12-24 hours straight, it begins using 100% CPU. Possibly a core srcds.exe bug, not an SDK bug?

I suppose there could be some array or something inside the HL2 core that grows over time, and must be iterated over each frame?

I haven't run the long-running map scenario in a long time. The alpha server for my mod is full most of the day and players frag out so the map is always changing.

That said, I seem to recall that the move from the usual 5% cpu to 100% cpu was fairly drastic and immediate. I never saw an intermediate stage where the server used 25% cpu or 50% cpu etc. I would expect to see those intermediate levels if it was a memory leak.

Workaround: Ensure you have mp_timelimit set to something nonzero, but less than 12 hours or so.


Issue: Negative entitygroundcontact crash. The implications of this SDK bug are not at all clear, but in debug mode you'll get an assert, and in release mode it will presumably segfault. Update: count < 0 isn't enough - I've changed it to also check > 128 or so.

Workaround:

--- mod/src/game_shared/usercmd.cpp 2005/02/18 04:45:54 1.1.1.1
+++ mod/src/game_shared/usercmd.cpp 2005/03/23 02:24:00
@@ -290,7 +290,12 @@
 #if defined( HL2_DLL )
     if ( buf->ReadOneBit() )
     {
-        move->entitygroundcontact.SetCount( buf->ReadShort() );
+        int count = buf->ReadShort();
+        if (count < 0) {
+        Msg("Ignoring strange entitygroundcontact count: %d\n", count);
+        return; // why can this be less than 0, Valve? change to ReadWord()???
+    }
+    move->entitygroundcontact.SetCount( count );

     int i;
     for (i = 0; i < move->entitygroundcontact.Count(); i++)

Issue: Doing a 360 quickly with the Stun Baton as your active weapon causes the screen to flash white

Workaround: Fix unknown


Issue: Assert on line 866 of mod/src/game_shared/basecombatweapon_shared.cpp

Workaround: I haven't been able to determine exactly why this is an assert. It's just "Assert(0);" with no accompanying explanation, but commenting it out results in no problems it seems.