Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tycross opened this issue Nov 13, 2022 · 2 comments

Comments

@Tycross
Copy link

Tycross commented Nov 13, 2022

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
Copy link
Author

Tycross commented Nov 15, 2022

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
Copy link
Author

Tycross commented Nov 15, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant