Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
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 Go to previous messageGo to previous message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma:
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 Razz )


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Thu, 06 October 2011 07:14]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: old tokenclass
Next Topic: Tool for renaming w3d-files?
Goto Forum:
  


Current Time: Sun Dec 01 21:56:46 MST 2024

Total time taken to generate the page: 0.00745 seconds