• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Help me understand a warning ("... hides overloaded virtual function")

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,249
Solutions
71
Reaction score
621
Location
Hell
I've compiled 3777 sources from Fir3Element's repository and the same warning has been popping up through the whole compiling proccess..

the warning message is : ./condition.h:279:8: warning: 'ConditionDamage::updateCondition' hides overloaded virtual function [-Woverloaded-virtual]

I wasn't sure what a "virtual function" was, so I looked it up and found the following answer which made sense:

Then in condition.h I looked at line 279 and found the following:
Code:
bool updateCondition(const ConditionDamage* addCondition);
also notcied that ConditionDamage was inheriting Condition.
Code:
class ConditionDamage: public Condition

in condition.h at line 145 ( Condition class ) I found the following.
Code:
virtual bool updateCondition(const Condition* addCondition);



now my question is why is updateCondition taking ConditionDamage* as a parameter and not Condition* ?
As far as I understood, that should be fine.

what would happen if I changed it to Condition instead (to work-around the warning)?
 
Back
Top