• 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!

Compiling [TFS 1.2] Using sub-id's to remove old conditions

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
Hello, I'm trying to make it so that when you cast a spell that adds a condition, it checks the sub-id of the old condition and the sub-id of the new, and if the new condition has a sub-id that's >= the old sub-id then it adds then new condition, and otherwise returns false. Am I on the right track here?
creature.cpp -> bool Creature::addCondition(Condition* condition, bool force/* = false*/)
Code:
    Condition* prevCond = getCondition(condition->getType(), condition->getId(), condition->getSubId());
    if (prevCond) {
        prevCond->addCondition(this, condition);
        delete condition;
        return true;
    }
   
    if (conditon->getSubId() >= prevCond->getSubId()) {
        return true;
    else
        return false;
    }
I'm getting the error that condition isn't indentified, and that is must have a class/struct/union. So how do I differentiate the previous condition from the condition being added, and compare their sub-id's.
 
Back
Top