• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


bug report
#11
There appears to be some bug here in the code, and I haven't figured out what it is yet:

Code:
Float:map_getMinutesElapsed()
{
    dbg_log(2, "%32s mp_timelimit: %f", "map_getMinutesElapsed(in/out)", get_cvar_float("mp_timelimit"));        
    return get_cvar_float("mp_timelimit") - (float(get_timeleft()) / 60.0);
}

public vote_rock(id)
{
    // if an early vote is pending, don't allow any rocks
    if (g_voteStatus & VOTE_IS_EARLY)
    {
        client_print(id, print_chat, "%L", id, "GAL_ROCK_FAIL_PENDINGVOTE");
        return;
    }
    
    new Float:minutesElapsed = map_getMinutesElapsed();
    
    // if the player is the only one on the server, bring up the vote immediately
    if (get_realplayersnum() == 1 && minutesElapsed > floatmin(2.0, g_rtvWait))
    {
        vote_startDirector(true);
        return;
    }

    // make sure enough time has gone by on the current map
    if (g_rtvWait)
    {
        if (minutesElapsed < g_rtvWait)
        {
            client_print(id, print_chat, "%L", id, "GAL_ROCK_FAIL_TOOSOON", floatround(g_rtvWait - minutesElapsed, floatround_ceil));
            return;
        }
    }

    // rocks can only be made if a vote isn't already in progress
    if (g_voteStatus & VOTE_IN_PROGRESS)
    {
        client_print(id, print_chat, "%L", id, "GAL_ROCK_FAIL_INPROGRESS");
        return;
    }
    // and if the outcome of the vote hasn't already been determined
    else if (g_voteStatus & VOTE_IS_OVER)
    {
        client_print(id, print_chat, "%L", id, "GAL_ROCK_FAIL_VOTEOVER");
        return;
    }
    
    // determine how many total rocks are needed
    new rocksNeeded = vote_getRocksNeeded();

    // make sure player hasn't already rocked the vote
    if (g_rockedVote[id])
    {
        client_print(id, print_chat, "%L", id, "GAL_ROCK_FAIL_ALREADY", rocksNeeded - g_rockedVoteCnt);
        rtv_remind(TASKID_REMINDER + id);
        return;
    }

    // allow the player to rock the vote
    g_rockedVote[id] = true;
    client_print(id, print_chat, "%L", id, "GAL_ROCK_SUCCESS");

    // make sure the rtv reminder timer has stopped
    if (task_exists(TASKID_REMINDER))
    {
        remove_task(TASKID_REMINDER);
    }

    // determine if there have been enough rocks for a vote yet    
    if (++g_rockedVoteCnt >= rocksNeeded)
    {
        // announce that the vote has been rocked
        client_print(0, print_chat, "%L", LANG_PLAYER, "GAL_ROCK_ENOUGH");

        // start up the vote director
        vote_startDirector(true);
    }
    else
    {
        // let the players know how many more rocks are needed
        rtv_remind(TASKID_REMINDER);
        
        if (get_pcvar_num(cvar_rtvReminder))
        {
            // initialize the rtv reminder timer to repeat how many rocks are still needed, at regular intervals
            set_task(get_pcvar_float(cvar_rtvReminder) * 60.0, "rtv_remind", TASKID_REMINDER, _, _, "b");
        }
    }
}
Reply

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Messages In This Thread
bug report - by Operator - 08-09-2016, 08:19 AM
RE: bug report - by swampdog - 08-09-2016, 08:52 AM
RE: bug report - by Operator - 08-09-2016, 09:38 AM
RE: bug report - by Sparechicken - 08-09-2016, 08:20 PM
RE: bug report - by Operator - 08-09-2016, 08:29 PM
RE: bug report - by Sparechicken - 08-10-2016, 08:50 AM
RE: bug report - by Operator - 08-10-2016, 10:51 AM
RE: bug report - by Sparechicken - 08-13-2016, 10:04 AM
RE: bug report - by effoR - 08-13-2016, 01:23 PM
RE: bug report - by Operator - 08-30-2016, 08:13 AM
RE: bug report - by swampdog - 08-30-2016, 09:32 PM
RE: bug report - by MrOats - 08-31-2016, 02:30 AM
RE: bug report - by MrOats - 09-01-2016, 03:13 AM
RE: bug report - by swampdog - 09-01-2016, 09:30 AM
RE: bug report - by effoR - 09-04-2016, 08:17 AM



Users browsing this thread:
4 Guest(s)

   
ABOUT US
ModRiotGaming is a multi modification based gaming community offering servers of all sorts customized by community input. We dedicated ourselves towards providing a drama/stress-free gaming experierce for all fellow gamers while hosting the classic half-life 1 based mods we all grew up on worldwide.