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

TFS 0.X doCreatureSetNoMove + auto follow bug

dami1310

◄ Unidentified ►
Joined
Jan 27, 2013
Messages
732
Solutions
12
Reaction score
664
Location
Poland
I use tfs 0.3.6 <-
When I use
Code:
doCreatureSetNoMove(target, false)
players can't move with a little exception.
If player had a target and auto follow mode he will keep following the target even if nomove is active.
If he stops targeting/tries to move etc. etc. he won't be able to move anymore even if he checks the auto follow again.
I want to block that of course, but I can't think of/find the right solution.
Any ideas?

PS. It would be good if that player could keep his target. Just stop moving.

If it helps you:
Code:
int32_t LuaScriptInterface::luaDoCreatureSetNoMove(lua_State* L)
{
    //doCreatureSetNoMove(cid, block)
    bool block = popNumber(L);

    ScriptEnviroment* env = getEnv();
    if(Creature* creature = env->getCreatureByUID(popNumber(L)))
    {
        creature->setNoMove(block);
        lua_pushboolean(L, true);
    }
    else
    {
        errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
        lua_pushboolean(L, false);
    }

    return 1;
}
 
I have it fixed now, if somebody needs then add
Code:
creature->stopEventWalk();
below
Code:
creature->setNoMove(block);
in the function I pasted in main post.
You can find it in luascript.cpp
 
Last edited:

Similar threads

Replies
2
Views
541
Back
Top