mrSkortch/DCS-SLmod

Error on vote

Enfarda opened this issue · 5 comments

afther vote is complete the message of changing map keep repeating and the map dont change.

SLMOD ERROR: slmod.scheduleFunctionByRt, error in scheduled function: [string "C:\Users\Enfarda\Saved Games\DCS.openbeta_server\Scripts/net/Slmodv7_5/SlmodVote.lua"]:190: attempt to index field '?' (a nil value)

Hmmm, well it doesn't error check to make sure that table entry exists, but shouldn't be possible for that table entry to not exist, unless it fails to add the mission itself to the table. But it shouldn't get to that point if that is the case.

Can you go into \Saved Games<DCS saved games folder>\Slmod\ and open slmodMetaStats.lua. Look for the mission you are trying to vote in and tell me if it is listed? Should see something like this:

["missionStats"] = 
{
    ["SomeMission"] = 
    {
        ["map"] = "PersianGulf",
        ["timesPlayed"] = 5,
        ["maxClients"] = 2,
        ["totalFlightHours"] = 0,
        ["voteEnabled"] = true,
        ["firstPlayed"] = "Dec 17, 2019 at 21 09 24",
        ["totalVoteLoaded"] = 0,
        ["mostRecentPlayed"] = "Dec 17, 2019 at 22 09 25",
        ["hoursHosted"] = 0.066846111111111,
    }, -- end of ["SomeMission"]

this is what i got in that function

{
    ["mapStats"] = 
    {
        ["Caucasus"] = 
        {
            ["totalFlightHours"] = 87.742513888887,
            ["mostRecentPlayed"] = "Jan 05, 2020 at 21 46 34",
            ["firstPlayed"] = "Oct 08, 2019 at 04 25 41",
            ["missions"] = 
            {
                ["⚔AIM☠SKILL⚔ Training.map"] = "Oct 08, 2019 at 04 25 41",
                ["⚔AIM☠SKILL⚔AirTraffic"] = "Jan 03, 2020 at 06 18 23",
                ["⚔AIM☠SKILL⚔ PvETraining"] = "Jan 04, 2020 at 05 08 18",
            }, -- end of ["missions"]
            ["maxClients"] = 37,
            ["timesPlayed"] = 321,
            ["hoursHosted"] = 937.62304555545,
        }, -- end of ["Caucasus"]
    }, -- end of ["mapStats"]
    ["missionStats"] = 
    {
        ["⚔AIM☠SKILL⚔ Training.map"] = 
        {
            ["map"] = "Caucasus",
            ["timesPlayed"] = 299,
            ["maxClients"] = 37,
            ["totalFlightHours"] = 74.747727222221,
            ["voteEnabled"] = true,
            ["firstPlayed"] = "Oct 08, 2019 at 04 25 41",
            ["totalVoteLoaded"] = 0,
            ["mostRecentPlayed"] = "Jan 03, 2020 at 23 22 29",
            ["hoursHosted"] = 887.49856944437,
        }, -- end of ["⚔AIM☠SKILL⚔ Training.map"]
        ["⚔AIM☠SKILL⚔AirTraffic"] = 
        {
            ["map"] = "Caucasus",
            ["timesPlayed"] = 15,
            ["maxClients"] = 5,
            ["totalFlightHours"] = 9.69423,
            ["voteEnabled"] = true,
            ["firstPlayed"] = "Jan 03, 2020 at 06 18 23",
            ["totalVoteLoaded"] = 0,
            ["mostRecentPlayed"] = "Jan 05, 2020 at 21 45 51",
            ["hoursHosted"] = 25.876074444445,
        }, -- end of ["⚔AIM☠SKILL⚔AirTraffic"]
        ["⚔AIM☠SKILL⚔ PvETraining"] = 
        {
            ["map"] = "Caucasus",
            ["timesPlayed"] = 7,
            ["maxClients"] = 4,
            ["totalFlightHours"] = 3.3005566666666,
            ["voteEnabled"] = true,
            ["firstPlayed"] = "Jan 04, 2020 at 05 08 18",
            ["totalVoteLoaded"] = 0,
            ["mostRecentPlayed"] = "Jan 05, 2020 at 21 46 34",
            ["hoursHosted"] = 24.248401666666,
        }, -- end of ["⚔AIM☠SKILL⚔ PvETraining"]
    }, -- end of ["missionStats"]
    ["missionStatsFile"] = 
    {
        ["currentMissionFile"] = "⚔AIM☠SKILL⚔ PvETraining- Jan 05, 2020 at 21 46 34.lua",
        ["previousMissionFile"] = "⚔AIM☠SKILL⚔AirTraffic- Jan 05, 2020 at 21 45 51.lua",
    }, -- end of ["missionStatsFile"]
} -- end of metaStats``

but the admin load function work. i can change map like that.

Ok fixed it. Since it was loading the mission file it had an extra .miz at the end and it was assuming it didn't have that when looking for a table index.

b5dfc69

ohh tks for the fast fix ^^
stay well and keep the good work

tested and working 👍