• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Programmer Need help with some code [PAID]

Kungenn

Veteran OT User
Joined
Jun 10, 2007
Messages
1,625
Reaction score
283
Location
USA California
Ok so I've run into a few problem with adding Shared Experience to OTHire.
I've got a talkaction that will start the shared experience but unless I remove the function that is checking if a player has been attacking something recently the shared exp never becomes active.

The message shown is just "
Shared Experience has been activated," \
" but some members of your party are inactive."

And it never becomes active, I tried it with two characters, both level 50 and it didn't work.

When I removed the code

Code:
    if(!player->hasFlag(PlayerFlag_NotGainInFight)){
        //check if the player has healed/attacked anything recently
        CountMap::const_iterator it = pointMap.find(player->getID());
        if(it == pointMap.end()){
            return false;
        }

        uint64_t timeDiff = OTSYS_TIME() - it->second.ticks;
        if(timeDiff > (uint32_t)g_config.getNumber(ConfigManager::IN_FIGHT_DURATION)){
            //player has not attacked or healed anyone for a period of infight ticks
            return false;
        }
    }

The shared experience message changes to

"Shared Experience is now active."

But if a player or monster dies while having shared exp active ther server crashes.

I need someone to help me fix this.

If you got the skills don't hesitate to message me,

Thanks in advance
 
Back
Top