diff --git a/Sources/Engine/Entities/Entity.cpp b/Sources/Engine/Entities/Entity.cpp index 336b5ac..a31a646 100644 --- a/Sources/Engine/Entities/Entity.cpp +++ b/Sources/Engine/Entities/Entity.cpp @@ -3534,7 +3534,7 @@ void CEntity::DumpSync_t(CTStream &strm, INDEX iExtensiveSyncCheck) // throw ch (ULONG&)en_mRotation(3,1), (ULONG&)en_mRotation(3,2), (ULONG&)en_mRotation(3,3)); if( en_pciCollisionInfo == NULL) { strm.FPrintF_t("Collision info NULL\n"); - } else if (en_RenderType==RT_BRUSH && en_RenderType==RT_FIELDBRUSH) { + } else if (en_RenderType==RT_BRUSH || en_RenderType==RT_FIELDBRUSH) { strm.FPrintF_t("Collision info: Brush entity\n"); } else { strm.FPrintF_t("Collision info:\n"); diff --git a/Sources/Engine/Graphics/Gfx_wrapper.h b/Sources/Engine/Graphics/Gfx_wrapper.h index 065377d..b05b942 100644 --- a/Sources/Engine/Graphics/Gfx_wrapper.h +++ b/Sources/Engine/Graphics/Gfx_wrapper.h @@ -177,7 +177,7 @@ public: GfxWrap tp_eWrapU, tp_eWrapV; // wrapping states inline CTexParams(void) { Clear(); tp_bSingleMipmap = FALSE; }; inline void Clear(void) { tp_iFilter = 00; tp_iAnisotropy = 0; tp_eWrapU = tp_eWrapV = (GfxWrap)NONE; }; - inline BOOL IsEqual( CTexParams tp) { return tp_iFilter==tp.tp_iFilter && tp_iAnisotropy==tp_iAnisotropy && + inline BOOL IsEqual( CTexParams tp) { return tp_iFilter==tp.tp_iFilter && tp_iAnisotropy==tp.tp_iAnisotropy && tp_eWrapU==tp.tp_eWrapU && tp_eWrapV==tp.tp_eWrapV; }; }; diff --git a/Sources/Engine/Network/SessionState.cpp b/Sources/Engine/Network/SessionState.cpp index 4a2fe44..6f42d10 100644 --- a/Sources/Engine/Network/SessionState.cpp +++ b/Sources/Engine/Network/SessionState.cpp @@ -1188,7 +1188,7 @@ void CSessionState::ProcessGameStream(void) } // if it is not avaliable yet - } if (res==CNetworkStream::R_BLOCKNOTRECEIVEDYET) { + } else if (res==CNetworkStream::R_BLOCKNOTRECEIVEDYET) { // finish _pfNetworkProfile.StopTimer(CNetworkProfile::PTI_SESSIONSTATE_PROCESSGAMESTREAM); return; diff --git a/Sources/Engine/Terrain/Terrain.cpp b/Sources/Engine/Terrain/Terrain.cpp index 0b03022..fcc98d9 100644 --- a/Sources/Engine/Terrain/Terrain.cpp +++ b/Sources/Engine/Terrain/Terrain.cpp @@ -558,7 +558,7 @@ void CTerrain::SetShadowMapsSize(INDEX iShadowMapAspect, INDEX iShadingMapAspect tr_iShadowMapSizeAspect = -(FastLog2(tr_pixHeightMapWidth-1)-5); } - if(GetShadingMapWidth()<32 || GetShadingMapWidth()<32) { + if(GetShadingMapWidth()<32 || GetShadingMapHeight()<32) { tr_iShadingMapSizeAspect = 0; } diff --git a/Sources/GameMP/Computer.cpp b/Sources/GameMP/Computer.cpp index a4d84e0..2316cf4 100644 --- a/Sources/GameMP/Computer.cpp +++ b/Sources/GameMP/Computer.cpp @@ -851,7 +851,7 @@ static void ComputerOn(void) _ppenPlayer->GetStats(_strStatsDetails, CST_DETAIL, _ctTextCharsPerRow); // if end of level - if (_ppenPlayer!=NULL && _ppenPlayer->m_bEndOfLevel || _pNetwork->IsGameFinished()) { + if (_ppenPlayer->m_bEndOfLevel || _pNetwork->IsGameFinished()) { // select statistics _cmtWantedType = CMT_STATISTICS; // if not end of level diff --git a/Sources/LWSkaExporter/ModelerMeshExporter.cpp b/Sources/LWSkaExporter/ModelerMeshExporter.cpp index ad3d752..cb55ee8 100644 --- a/Sources/LWSkaExporter/ModelerMeshExporter.cpp +++ b/Sources/LWSkaExporter/ModelerMeshExporter.cpp @@ -413,13 +413,13 @@ void ExportMesh_modeler(int iFaceForward) { char fnmOut[256]; char *strFileName; - _state = _meshEditOperations->state; - if (_meshEditOperations == NULL) { - _msg->error("Error!","Error _meshEditOperations is NULL!"); + _msg->error("Error!", "Error _meshEditOperations is NULL!"); return; } + _state = _meshEditOperations->state; + _ctPntIDs = _meshEditOperations->pointCount(_state,OPLYR_FG,EDCOUNT_ALL); _ctPolIDs = _meshEditOperations->polyCount(_state,OPLYR_FG,EDCOUNT_ALL); @@ -438,6 +438,7 @@ void ExportMesh_modeler(int iFaceForward) { _fpOutput = fopen(fnmOut, "w"); if (_fpOutput==NULL) { msgbox_modeler(_xpanf, "Can't open file!"); + return; } // write the mesh header diff --git a/Sources/SeriousSam/Menu.cpp b/Sources/SeriousSam/Menu.cpp index aa2f63e..5d5d7f9 100644 --- a/Sources/SeriousSam/Menu.cpp +++ b/Sources/SeriousSam/Menu.cpp @@ -1185,7 +1185,7 @@ void JoinNetworkGame(void) _pNetwork->ga_strRequiredMod.ScanF("%250[^\\]\\%s", &strModName, &strModURL); _fnmModSelected = CTString(strModName); _strModURLSelected = strModURL; - if (_strModURLSelected="") { + if (_strModURLSelected == "") { _strModURLSelected = "http://www.croteam.com/mods/Old"; } _strModServerSelected.PrintF("%s:%s", _pGame->gam_strJoinAddress, _pShell->GetValue("net_iPort")); diff --git a/Sources/WorldEditor/MainFrm.cpp b/Sources/WorldEditor/MainFrm.cpp index 740edb9..470a86e 100644 --- a/Sources/WorldEditor/MainFrm.cpp +++ b/Sources/WorldEditor/MainFrm.cpp @@ -694,7 +694,7 @@ void CMainFrame::OnCancelMode() { // switches out of eventual direct screen mode CWorldEditorView *pwndView = (CWorldEditorView *)GetActiveView(); - if (pwndView = NULL) { + if (pwndView != NULL) { // get the MDIChildFrame of active window CChildFrame *pfrChild = (CChildFrame *)pwndView->GetParentFrame(); ASSERT(pfrChild!=NULL); @@ -707,7 +707,7 @@ void CMainFrame::OnInitMenu(CMenu* pMenu) { // switches out of eventual direct screen mode CWorldEditorView *pwndView = (CWorldEditorView *)GetActiveView(); - if (pwndView = NULL) { + if (pwndView != NULL) { // get the MDIChildFrame of active window CChildFrame *pfrChild = (CChildFrame *)pwndView->GetParentFrame(); ASSERT(pfrChild!=NULL); diff --git a/Sources/WorldEditor/PropertyComboBar.cpp b/Sources/WorldEditor/PropertyComboBar.cpp index f6a3c7f..eb858c2 100644 --- a/Sources/WorldEditor/PropertyComboBar.cpp +++ b/Sources/WorldEditor/PropertyComboBar.cpp @@ -1851,8 +1851,8 @@ CEntity *CPropertyComboBar::GetSelectedEntityPtr(void) CPropertyID *ppidProperty = GetSelectedProperty(); // if there is valid property selected if( (ppidProperty == NULL) || - (ppidProperty->pid_eptType != CEntityProperty::EPT_ENTITYPTR) || - (ppidProperty->pid_eptType != CEntityProperty::EPT_PARENT) ) + ((ppidProperty->pid_eptType != CEntityProperty::EPT_ENTITYPTR) && + (ppidProperty->pid_eptType != CEntityProperty::EPT_PARENT)) ) { return NULL; } diff --git a/Sources/WorldEditor/ToolTipWnd.cpp b/Sources/WorldEditor/ToolTipWnd.cpp index e996e64..a22c2b8 100644 --- a/Sources/WorldEditor/ToolTipWnd.cpp +++ b/Sources/WorldEditor/ToolTipWnd.cpp @@ -135,8 +135,8 @@ void CToolTipWnd::OnPaint() dc.SetTextColor( colInk); CDC *pDC = GetDC(); + if (pDC == NULL) return; pDC->SelectObject( &theApp.m_FixedFont); - if( pDC == NULL) return; INDEX ctLines = GetLinesCount(); for(INDEX iLine = 0; iLinem_CSGDesitnationCombo.GetSelectedBrushEntity(); - CBrush3D &brBrush = *penBrush->en_pbrBrush; - if (penBrush==NULL) return; + if (penBrush == NULL) return; + + CBrush3D &brBrush = *penBrush->en_pbrBrush; // remember current time as time when last mip brushing option has been used _fLastMipBrushingOptionUsed = _pTimer->GetRealTimeTick();