Home » Renegade Discussions » Mod Forum » Find_My_Vehicle
|
|
Re: Find_My_Vehicle [message #456960 is a reply to message #456821] |
Thu, 06 October 2011 07:10   |
 |
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma: 0
|
General (5 Stars) |
|
|
VehicleGameObject pVehicleObj = Find_My_Vehicle();
GameObject* pObject = dynamic_cast<GameObject*>(pVehicleObj);
Or...
GameObject* pObject = dynamic_cast<GameObject*>(Find_My_Vehicle());
Or...
GameObject* pObject = (GameObject*)Find_My_Vehicle();
(PS: If you didn't already figure it out, VehicleGameObject *is* a GameObject, since it's a derived class)
(PPS: Yes, I know dynamic casting a subclass to its superclass is redundant since it's always going to succeed, just illustrating my point )
[Updated on: Thu, 06 October 2011 07:14] Report message to a moderator
|
|
|
Re: Find_My_Vehicle [message #457022 is a reply to message #456821] |
Thu, 06 October 2011 17:28   |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma: 0
|
Recruit |
|
|
ok that works although i dont understand how it works i gues i understand it somehow on some way XD im just a nooby in programmin
Owner of kambot TT server
kambot.freeforums.org
|
|
|
|
|
Goto Forum:
Current Time: Mon Mar 03 03:49:26 MST 2025
Total time taken to generate the page: 0.00904 seconds
|