Skip to content

Instantly share code, notes, and snippets.

@RootKiller
Last active November 2, 2022 07:41
Show Gist options
  • Save RootKiller/6a5bc07a0c8dab7aaa037a308e92ce46 to your computer and use it in GitHub Desktop.
Save RootKiller/6a5bc07a0c8dab7aaa037a308e92ce46 to your computer and use it in GitHub Desktop.
const float MaxObjectMassToGrabKg = 50.0f;
// Before
bool AJanuszCharacter::IsAbleToGrabComponent(UPrimitiveComponent* Component) const
{
if (Component->CalculateMass() > MaxObjectMassToGrabKg)
{
return false;
}
return true;
}
// After
bool AJanuszCharacter::IsAbleToGrabComponent(UPrimitiveComponent* Component) const
{
return (Component->CalculateMass() <= MaxObjectMassToGrabKg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment