Skip to content

Commit d6822c6

Browse files
authored
Merge pull request #132 from z33ky/mb/breakablebrush_spawnobject
Fix console error on BreakableBrushes without spawnobject
2 parents 4eae5f4 + 7ad1276 commit d6822c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sp/src/game/server/func_break.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ bool CBreakable::KeyValue( const char *szKeyName, const char *szValue )
221221
if ( object > 0 && object < ARRAYSIZE(pSpawnObjects) )
222222
m_iszSpawnObject = MAKE_STRING( pSpawnObjects[object] );
223223
#ifdef MAPBASE
224+
// "0" is the default value of a "choices" field in Hammer, representing nothing selected
225+
// atoi() returning 0 may also indicate a failed conversion, so check szValue directly
226+
else if ( FStrEq( szValue, "0" ) )
227+
m_iszSpawnObject = NULL_STRING;
224228
else
225229
m_iszSpawnObject = AllocPooledString(szValue);
226230
#endif

0 commit comments

Comments
 (0)