Skip to content

Commit

Permalink
Removed redundant initialization (fixes #75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Smit committed Feb 21, 2017
1 parent 6c95703 commit a72f15b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion luamods/wolfadmin/admin/balancer.lua
Expand Up @@ -32,7 +32,7 @@ balancer.BALANCE_LAST_JOINED = 1
balancer.BALANCE_ONLY_DEAD = 2
balancer.BALANCE_NOT_OBJECTIVE = 4

local balancerTimer = nil
local balancerTimer

local lastJoined = {[constants.TEAM_AXIS] = {}, [constants.TEAM_ALLIES] = {}, [constants.TEAM_SPECTATORS] = {}}
local evenerCount = 0
Expand Down
6 changes: 3 additions & 3 deletions luamods/wolfadmin/commands/commands.lua
Expand Up @@ -201,7 +201,7 @@ function commands.onClientCommand(clientId, command)

-- client cmds
-- syntax: say or say_*
local clientCmd = nil
local clientCmd

if (wolfCmd == "say" or wolfCmd == "say_team" or wolfCmd == "say_buddy") and string.find(et.trap_Argv(1), "/") == 1 then
args = util.split(et.trap_Argv(1), " ")
Expand Down Expand Up @@ -233,8 +233,8 @@ function commands.onClientCommand(clientId, command)
end

-- shrub cmds
local shrubCmd = nil
local shrubCmd

-- syntax: say or say_*
if (wolfCmd == "say" or wolfCmd == "say_team" or wolfCmd == "say_buddy") and string.find(et.trap_Argv(1), "!") == 1 then
args = util.split(et.trap_Argv(1), " ")
Expand Down
4 changes: 2 additions & 2 deletions luamods/wolfadmin/db/mysql.lua
Expand Up @@ -26,8 +26,8 @@ local luasql = require "luasql.mysql"
local mysql = {}

local env = assert(luasql.mysql())
local con = nil
local cur = nil
local con
local cur

-- players
function mysql.addplayer(guid, ip)
Expand Down
4 changes: 2 additions & 2 deletions luamods/wolfadmin/db/sqlite3.lua
Expand Up @@ -27,8 +27,8 @@ local luasql = require "luasql.sqlite3"
local sqlite3 = {}

local env = assert(luasql.sqlite3())
local con = nil
local cur = nil
local con
local cur

-- players
function sqlite3.addplayer(guid, ip)
Expand Down
7 changes: 4 additions & 3 deletions luamods/wolfadmin/game/game.lua
Expand Up @@ -24,10 +24,11 @@ local players = require (wolfa_getLuaPath()..".players.players")
local game = {}

local killCount = 0
local lastKillerId = nil
local lastKillerId

local currentState = nil
local currentMaps, currentMap, nextMap = {}, nil, nil
local currentState
local currentMaps = {}
local currentMap, nextMap

function game.getState()
return currentState
Expand Down
6 changes: 3 additions & 3 deletions luamods/wolfadmin/main.lua
Expand Up @@ -53,9 +53,9 @@ local util
local version = "1.2.0-dev"
local release = "TBD"

local basepath = nil
local homepath = nil
local luapath = nil
local basepath
local homepath
local luapath

-- need to do this somewhere else
function wolfa_getVersion()
Expand Down
4 changes: 2 additions & 2 deletions luamods/wolfadmin/util/events.lua
Expand Up @@ -87,8 +87,8 @@ function events.trigger(name, ...)
error("event not added: "..name)
end

local returnValue = nil
local returnValue

for _, handler in pairs(handlers) do
local handlerReturn = handler(...)

Expand Down

0 comments on commit a72f15b

Please sign in to comment.