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

Creature.cpp error RemoveCondition

Sunnad

New Member
Joined
Aug 9, 2024
Messages
11
Reaction score
1
Good afternoon, when a player dies due to a boss or monster, I'm getting an error in two parts of the creature.cpp and the server is crashing. My server is a TFS 1.4.2 v10.98

I get an error in these functions exactly


C++:
void Creature::removeCondition(Condition* condition, bool force/* = false*/)
{
    auto it = std::find(conditions.begin(), conditions.end(), condition);
    if (it == conditions.end()) {
        return;
    }

    if (!force && condition->getType() == CONDITION_PARALYZE) {
        int64_t walkDelay = getWalkDelay();
        if (walkDelay > 0) {
            g_scheduler.addEvent(createSchedulerTask(walkDelay, std::bind(&Game::forceRemoveCondition, &g_game, getID(), condition->getType())));
            return;
        }
    }

    conditions.erase(it); <---- Here

    condition->endCondition(this);
    onEndCondition(condition->getType());
    delete condition;
}



C++:
Condition* Creature::getCondition(ConditionType_t type, ConditionId_t conditionId, uint32_t subId/* = 0*/) const
{
    for (Condition* condition : conditions) {
        if (condition->getType() == type && condition->getId() == conditionId && condition->getSubId() == subId) { <---- Here
            return condition;
        }
    }
    return nullptr;
}



1751412459354.webp
 
You don't need to compile anything.

Download completed engine, scroll down to section, " assets", choose (if you have windows),  windows-vcpkg, replace only dll files and forgottenserver file.
Test.
 
Last edited:
You don't need to compile anything.

Download completed engine, scroll down to section, " assets", choose (if you have windows),  windows-vcpkg, replace only dll files and forgottenserver file.
Test.
downloading precompiled engine is not a solution

@Sunnad what errors are you getting?
 
Back
Top