Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum PhysGunPickup_t
- {
- PICKED_UP_BY_CANNON,
- PUNTED_BY_CANNON,
- PICKED_UP_BY_PLAYER, // Picked up by +USE, not physgun.
- };
- enum PhysGunDrop_t
- {
- DROPPED_BY_PLAYER,
- THROWN_BY_PLAYER,
- DROPPED_BY_CANNON,
- LAUNCHED_BY_CANNON,
- };
- void CBreakableProp::OnPhysGunDrop(...., PhysGunDrop_t Reason)
- {
- ....
- if( Reason == PUNTED_BY_CANNON )
- {
- PlayPuntSound();
- }
- ....
- }
- This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
- Warning message is:
- V556 The values of different enum types are compared: Reason == PUNTED_BY_CANNON. Server (HL2) props.cpp 1520
- 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