A parenthesis in a wrong place
V639 Consider inspecting the expression for ‘ShouldRecordEvent’ function call. It is possible that one of the closing ‘)’ brackets was positioned incorrectly. actortelemetry.cpp 288
bool ShouldRecordEvent(size_t eventID, IActor* pActor=NULL) const; void CActorTelemetry::SubscribeToWeapon(EntityId weaponId) { .... else if(pMgr->ShouldRecordEvent(eSE_Weapon), pOwnerRaw) .... }
It’s a rare and interesting bug – a closing parenthesis is written in a wrong place.
The point is that the ShouldRecordEvent() function’s second argument is optional. It turns that the ShouldRecordEvent() function is called first, and then the comma operator ‘,‘ returns the value on the right. The condition depends on the ‘pOwnerRaw‘ variable alone.
Please click here to see more bugs from this project.