Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix several bugs from iodoom3 bugtracker

rhyskidd@gmail.com found them (with PVS studio IIRC), reported them and posted
patches.
Some of the patches were incorrect so I rewrote them.
  • Loading branch information...
commit 94cd0ee5596a15fec12ecbadae94c40ac56ceb3d 1 parent 1e087d9
@DanielGibson DanielGibson authored dhewg committed
View
9 neo/game/Game_local.cpp
@@ -1257,8 +1257,8 @@ bool idGameLocal::InitFromSaveGame( const char *mapName, idRenderWorld *renderWo
if ( !InhibitEntitySpawn( mapEnt->epairs ) ) {
CacheDictionaryMedia( &mapEnt->epairs );
- const char *classname = mapEnt->epairs.GetString( "classname" );
- if ( classname != '\0' ) {
+ const char *classname;
+ if ( mapEnt->epairs.GetString( "classname", "", &classname ) ) {
FindEntityDef( classname, false );
}
}
@@ -1626,8 +1626,9 @@ void idGameLocal::GetShakeSounds( const idDict *dict ) {
const char *soundShaderName;
idStr soundName;
- soundShaderName = dict->GetString( "s_shader" );
- if ( soundShaderName != '\0' && dict->GetFloat( "s_shakes" ) != 0.0f ) {
+ if ( dict->GetString( "s_shader", "", &soundShaderName )
+ && dict->GetFloat( "s_shakes" ) != 0.0f )
+ {
soundShader = declManager->FindSound( soundShaderName );
for ( int i = 0; i < soundShader->GetNumSounds(); i++ ) {
View
2  neo/renderer/Model_liquid.cpp
@@ -399,8 +399,6 @@ void idRenderModelLiquid::InitFromFile( const char *fileName ) {
} else if ( !token.Icmp( "shader" ) ) {
parser.ReadToken( &token );
shader = declManager->FindMaterial( token );
- } else if ( !token.Icmp( "seed" ) ) {
- seed = parser.ParseInt();
} else if ( !token.Icmp( "update_rate" ) ) {
rate = parser.ParseFloat();
if ( ( rate <= 0.0f ) || ( rate > 60.0f ) ) {
View
2  neo/tools/radiant/XYWnd.cpp
@@ -4285,7 +4285,7 @@ void CXYWnd::Paste()
int nLen = g_Clipboard.GetLength();
char *pBuffer = new char[nLen + 1];
- memset(pBuffer, 0, sizeof(pBuffer));
+ memset(pBuffer, 0, sizeof(*pBuffer) * (nLen + 1));
g_Clipboard.Read(pBuffer, nLen);
pBuffer[nLen] = '\0';
Map_ImportBuffer(pBuffer, !(GetAsyncKeyState(VK_SHIFT) & 0x8000));
View
4 neo/tools/radiant/splines.cpp
@@ -1565,10 +1565,6 @@ bool idCameraPosition::parseToken( const idStr &key, idParser *src ) {
name = token;
return true;
}
- else if ( !key.Icmp( "time" ) ) {
- time = src->ParseInt();
- return true;
- }
else {
src->Error( "unknown camera position key: %s", key.c_str() );
return false;
Please sign in to comment.
Something went wrong with that request. Please try again.