OneLoneCoder / Javidx9

The official distribution of Javidx9's YouTube videos and projects
http://www.youtube.com/javidx9
Other
2.06k stars 1.29k forks source link

RPG_Main.cpp(55,24): error C2440: '=': cannot convert from 'OneLoneCoder_RPG *' to 'RPG_Engine *' #77

Open Tycross opened 1 year ago

Tycross commented 1 year ago

Hey, I am new to C++ and tried to get the game working.

But I stuck in RPG_Main.cpp Line 55: cCommand::g_engine = this; --> error: RPG_Main.cpp(55,24): error C2440: '=': cannot convert from 'OneLoneCoder_RPG ' to 'RPG_Engine ' RPG_Main.cpp(55,24): message : Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast

Did I miss anything?

Tycross commented 1 year ago

the game compiles once I remove this line but then you can only run on the first map(, kill the skeletons but once you enter the house "nothing" happens)

I assume it is an inheritance thing but I can't find it.

Tycross commented 1 year ago

weirdly enough. When I exchange this line with cCommand::g_engine = (RPG_Engine *)this; it compiles too but this time the door has a circle and there is an extra life on the ground but still the room doesn't load