RE: bug report - swampdog - 08-30-2016
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");
}
}
}
RE: bug report - MrOats - 08-31-2016
I can see this being a problem:
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);
}
As effor mentioned earlier, infinite time on a map could be a problem. I don't know what that would return if the map time is infinite.
I feel as though there should be some static time in minutes set by a config file. Three minutes is pretty good.
RE: bug report - MrOats - 09-01-2016
I have confirmed maps with "Infinite" time left on it will not allow players to RTV.
RE: bug report - swampdog - 09-01-2016
I will experiment with this a bit. If I can't manage to fix it, we will probably switch to another plugin (probably this one : http://forums.svencoop.com/showthread.php/43917-Plugin-RockTheVote ) This Angelscript rock the vote plugin is a bit more confusing to use, but it probably works better for Sven Coop than this version of Galileo. If a "vote menu" could be added to this Angelscript plugin, it would be a lot easier and less confusing to use...
RE: bug report - effoR - 09-04-2016
(09-01-2016, 03:13 AM)MrOats Wrote: I have confirmed maps with "Infinite" time left on it will not allow players to RTV.
yup this is an old problem. it has to do that the code bases the time "elapsed" based on the time left on the map. When there is an infinite timelimit it doesnt count down at all. Solution would probably be to for the RTV function to run on a separate timer
|