I think what bstone has said previously is correct, what is the code for applyForce anyway?

And if you cannot reveal the source code, place breakpoint inside applyForce, and see if the code manages to reach there before throwing exception - this what I would do if I were you.
Btw, on the design issue you can just make things more flexible by doing this:-
Code: Select all
class GameObject {
...
..
virtual void setProperty(const String& key, const String& value)=0;
};
class Copter : public GameObject {
virtual void setProperty(const String& key, const String& value) {
if (key == "apply_force")
applyForce(StringConverter::parseReal(value));
}
That way, you do not have to detect (and then cast) which class an object belongs to, as you only need to execute setProperty which is available for all classes derived from GameObject.