Superweird error

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Superweird error

Post by Yumtard » February 2nd, 2017, 2:17 am

I'm trying to add a sound effect in shield.cpp

if I make a sound object then the compiler says
'ShieldManager::ShieldManager(const ShieldManager &)': attempting to reference a deleted function

if I just uncomment the sound object in shield.h it's no problem

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Superweird error

Post by chili » February 2nd, 2017, 2:24 am

Looks like you're trying to copy ShieldManager, and the compiler doesn't like that because shield manager contains a sound.

Sounds can't be copied, they must be moved.

I recommend, for the time being, just make the Game class own the sounds. You can have ShieldManager maintain a ref& if you like.
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Superweird error

Post by Yumtard » February 2nd, 2017, 2:34 am

Thanks chili! That did the trick :)

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Superweird error

Post by chili » February 2nd, 2017, 2:39 am

np broski
Chili

Post Reply