diff --git a/dGame/Entity.h b/dGame/Entity.h index 251bac888..906e5e8a4 100644 --- a/dGame/Entity.h +++ b/dGame/Entity.h @@ -526,6 +526,8 @@ inline ComponentType* Entity::AddComponent(VaArgs... args) { } else { // In this case the block is already allocated and ready for use // so we use a placement new to construct the component again as was requested by the caller. + // Placement new means we already have memory allocated for the object, so this just calls its constructor again. + // This is useful for when we want to create a new object in the same memory location as an old one. new(componentToReturn) ComponentType(this, std::forward(args)...); }