CryEngine 3 SDK


BUG OF THE MONTH | 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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.