Ok, while I managed to resolve the ambiguities, I found it ugly to have two 
different instances of CBaseEntity in one object. So I’ve changed CScannable to 
have no base, but this brings me to another question, for which I fear I 
already know the answer and which will probably force me to go with the two 
CBaseEntity instances: is it possible to have DATADESCs with keyfields for use 
in hammer without being an entity or does my class need to be derived from 
CBaseEntity to do that?


-Krzysztof






From: Krzysztof Lesiak
Sent: ‎Sunday‎, ‎18‎ ‎May‎, ‎2014 ‎22‎:‎53
To: hlcoders@list.valvesoftware.com





Good evening,




I’ve come across a problem regarding multiple inheritance:




I have created a class CScannable that derives from CBaseEntity and implements 
common functionality for objects that I’d like to be scannable. I wanted to use 
this class to extend e.g. the existing prop classes, like CDynamicProp, so I’ve 
made a new class derived from CDynamicProp and CScannable. That’s where the 
problem starts and the compiler gives me this error in util.h(132):




error C2385: ambiguous access of 'NetworkProp' (props.cpp) 

6>          could be the 'NetworkProp' in base 'CBaseEntity' 

6>          or could be the 'NetworkProp' in base 'CBaseEntity'





How can I resolve this, or (noob question) why is this even a problem? I’ve 
seen examples for name conflicts with multiple inheritance on the web, but 
those usually involved having two different classes with the same method names, 
not a single base class.




-Krzysztof
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Reply via email to