• Fretta fretta_voting Bug
    2 replies, posted
I found a small but in the fretta voting system. If you set the convar fretta_voting to 0 ( false ) then the players cant vote for maps. Here is the votemap function: ( Taken from luabin.foszor.com gamemodes/fretta/sv_gmchanger.lua ) [CODE] function GM:VotePlayMap( ply, map ) if ( !map ) then return end if ( !GAMEMODE.WinningGamemode ) then return end if ( !GAMEMODE:InGamemodeVote() ) then return end if ( !GAMEMODE:IsValidGamemode( GAMEMODE.WinningGamemode, map ) ) then return end ply:SetNWString( "Wants", map ) end concommand.Add( "votemap", function( pl, cmd, args ) GAMEMODE:VotePlayMap( pl, args[1] ) end ) [/CODE]The problem is: It cheks if there is a gamemode vote. ( The gamemode check functionis super simple : it returns the global bool: "InGamemodeVote") Here is the StartGamemodeVote code: [CODE] if ( fretta_voting:GetBool() ) then GAMEMODE:ClearPlayerWants() BroadcastLua( "GAMEMODE:ShowGamemodeChooser()" ); SetGlobalBool( "InGamemodeVote", true ) else GAMEMODE.WinningGamemode = GAMEMODE.FolderName return GAMEMODE:StartMapVote() end [/CODE]If the fretta voting is disabled it skips the gamemode vote part BUT it not sets the global var "InGamemodeVote" so when the map vote function checks if there is a gamemode vote then it returns false and wont let the players to vote for the map. Please fix this Garry!
fretta_voting is meant to disable voting, including map voting. A new convar for map voting wouldn't hurt though.
I made a quick fix for it. It solves the problem temporary. [LUA] if ( SERVER ) then local function OverrideFrettaVote() if ( !frettaVoteOverriden ) then local oldStartGVoting = GAMEMODE.StartGamemodeVote function GAMEMODE:StartGamemodeVote() if( !GAMEMODE.m_bVotingStarted )then SetGlobalBool( "InGamemodeVote" , true ) end oldStartGVoting( GAMEMODE ) end frettaVoteOverriden = true end ErrorNoHalt( "= Fretta voting bug fix loaded = \n" ) end timer.Simple( 3 , OverrideFrettaVote ) ErrorNoHalt( "= Fretta voting bug fix file included. = \n" ) end [/LUA] Put it in the server autorun folder. It should work.
Sorry, you need to Log In to post a reply to this thread.