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

Lua Stamina BUG (player die = stamina full)

natanl2

New Member
Joined
May 4, 2012
Messages
28
Reaction score
0
Hello.

I'm with a big problem in my OTserver, when a player dies, his stamina gets full. I need to fix it ASAP.

Thanks!
 
Have you changed anything in your database?
Or added any scripts recently?
Need more information..

I added a lot of scripts in my server, but everything seens to works fine. What could possibly make it happen? I can check it...

he didn't even said which server he is using lol

I'm sorry, Evil.

My server is:

Global FULL - TFS 0.4 - 8.6
 
The only script about stamina is the stamina refuel:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cfg = {}
    cfg.refuel = 42 * 60 * 1000
    if(getPlayerStamina(cid) >= cfg.refuel) then
        doPlayerSendCancel(cid, "Your stamina is already full.")
    else
        doPlayerSetStamina(cid, cfg.refuel)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
        doRemoveItem(item.uid,1)
    end
    return true
end

Thanks!
 
It's in the sources. I remember correcting this sometime around client 9.7, can't remember exactly where the issue was though. The problem is that the stamina isn't getting saved with your character at death, so it gets reset to your last login iirc.
 
The only script about stamina is the stamina refuel:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cfg = {}
    cfg.refuel = 42 * 60 * 1000
    if(getPlayerStamina(cid) >= cfg.refuel) then
        doPlayerSendCancel(cid, "Your stamina is already full.")
    else
        doPlayerSetStamina(cid, cfg.refuel)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
        doRemoveItem(item.uid,1)
    end
    return true
end

Thanks!

42 minutes ? That's not refilled.
 
It's in the sources. I remember correcting this sometime around client 9.7, can't remember exactly where the issue was though. The problem is that the stamina isn't getting saved with your character at death, so it gets reset to your last login iirc.

Yeaa, you're right! Another member of the forum said that it is in the sources, but he doesn't remember where... Do you have a friend or anyone that might know? I really need to fix it.

Thanks

42 minutes ? That's not refilled.

Why not? :O
 
If you search for the stamina somewhere in "configmanager.h" I guess you can find it. And then locate where to change the stamina. ( Since you can change the samina in config.lua)
 
If you search for the stamina somewhere in "configmanager.h" I guess you can find it. And then locate where to change the stamina. ( Since you can change the samina in config.lua)

That is not correct. I believe the changes were in player.cpp, but it has been a long time and I dont quite remember.

It's unlikely that anyone else will have more info, I've already looked through old commits from that time frame and it must have been notated to reference an issue, which can't be traced since the old issue tracker is not available anymore (already checked with Mark on this).

If I can find any spare time I will try to locate to post the changes, but these days I am extremely busy.
 
Probably it's incorrect. But can't you locate the script by right-clicking on it? It's a quite long time ago since I tried MSVC. I thought you could locate the stamina in that way.
 
Last edited:
Probably it's incorrect. But can't you locate the script by right-clicking on it? It's a quite long time ago since I tried MSVC. I thought you could locate the stamina in that way.
That is not correct. I believe the changes were in player.cpp, but it has been a long time and I dont quite remember.

It's unlikely that anyone else will have more info, I've already looked through old commits from that time frame and it must have been notated to reference an issue, which can't be traced since the old issue tracker is not available anymore (already checked with Mark on this).

If I can find any spare time I will try to locate to post the changes, but these days I am extremely busy.

Thanks for trying to help, I am still trying to found something in these two .cpp that you said. This is another bug that I have to fix, someone knows how? http://otland.net/threads/monsters-dont-walk-above-corpses.219659/
 
Back
Top