PVS-StudioWarnings

PVS-Studio warning V523 for CryEngineSDK

Nov 11th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. bool CGameRules::
  2. ShouldGiveLocalPlayerHitableFee...OnCrosshairHoverForEntityClass
  3. (const IEntityClass* pEntityClass) const
  4. {
  5.   assert(pEntityClass != NULL);
  6.  
  7.   if(gEnv->bMultiplayer)
  8.   {
  9.     return
  10.       (pEntityClass == s_pSmartMineClass) ||
  11.       (pEntityClass == s_pTurretClass) ||
  12.       (pEntityClass == s_pC4Explosive);
  13.   }
  14.   else
  15.   {
  16.     return
  17.       (pEntityClass == s_pSmartMineClass) ||
  18.       (pEntityClass == s_pTurretClass) ||
  19.       (pEntityClass == s_pC4Explosive);
  20.   }
  21. }
  22.  
  23. This suspicious code was found in CryEngineSDK project by PVS-Studio static code analyzer.
  24. Warning message is:
  25. V523 The 'then' statement is equivalent to the 'else' statement. gamerules.cpp 5401
  26.  
  27. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment