Merge pull request #132 from z33ky/mb/breakablebrush_spawnobject

Fix console error on BreakableBrushes without spawnobject
This commit is contained in:
Blixibon 2021-09-25 11:25:00 -05:00 committed by GitHub
commit d6822c66f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,6 +221,10 @@ bool CBreakable::KeyValue( const char *szKeyName, const char *szValue )
if ( object > 0 && object < ARRAYSIZE(pSpawnObjects) ) if ( object > 0 && object < ARRAYSIZE(pSpawnObjects) )
m_iszSpawnObject = MAKE_STRING( pSpawnObjects[object] ); m_iszSpawnObject = MAKE_STRING( pSpawnObjects[object] );
#ifdef MAPBASE #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 else
m_iszSpawnObject = AllocPooledString(szValue); m_iszSpawnObject = AllocPooledString(szValue);
#endif #endif