Skip to content

Commit

Permalink
Merge pull request mapbase-source#132 from z33ky/mb/breakablebrush_sp…
Browse files Browse the repository at this point in the history
…awnobject

Fix console error on BreakableBrushes without spawnobject
  • Loading branch information
Blixibon authored Sep 25, 2021
2 parents aee2d18 + d185d3d commit f0b4212
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sp/src/game/server/func_break.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ bool CBreakable::KeyValue( const char *szKeyName, const char *szValue )
if ( object > 0 && object < ARRAYSIZE(pSpawnObjects) )
m_iszSpawnObject = MAKE_STRING( pSpawnObjects[object] );
#ifdef MAPBASE
// "0" is the default value of a "choices" field in Hammer, representing nothing selected
// atoi() returning 0 may also indicate a failed conversion, so check szValue directly
else if ( FStrEq( szValue, "0" ) )
m_iszSpawnObject = NULL_STRING;
else
m_iszSpawnObject = AllocPooledString(szValue);
#endif
Expand Down

0 comments on commit f0b4212

Please sign in to comment.