fix: remove some call to non-existing variables

This commit is contained in:
Kazhnuz 2020-09-13 16:49:50 +02:00
parent 0114927ac0
commit 877de98f67
10 changed files with 12 additions and 12 deletions

View file

@ -189,7 +189,7 @@ function BaseWorld:registerBody(body)
end end
function BaseWorld:updateBody(body) function BaseWorld:updateBody(body)
return x, y, {}, 0 return self.x, self.y, {}, 0
end end
function BaseWorld:removeBody(body) function BaseWorld:removeBody(body)
@ -239,7 +239,7 @@ function BaseWorld:addPlayer(x, y, z, id)
local player = {} local player = {}
if id <= self.playerNumber then if id <= self.playerNumber then
player.actor = self:newPlayer(x, y, z) player.actor = self:newPlayer(x, y, z)
player.sourceid = sourceid or 1 player.sourceid = id or 1
table.insert(self.players, player) table.insert(self.players, player)

View file

@ -83,7 +83,6 @@ function Graphics.box(x, y, w, h)
local y = math.floor(y) local y = math.floor(y)
local w = math.floor(w) local w = math.floor(w)
local h = math.floor(h) local h = math.floor(h)
local a = a or 1
local r, g, b, a = love.graphics.getColor( ) local r, g, b, a = love.graphics.getColor( )

View file

@ -113,7 +113,7 @@ function Math.numberToString(x, length)
local string = "" local string = ""
local x = x local x = x
if (x >= math.pow(10, length)) then if (x >= math.pow(10, length)) then
x = unitsNumber*10 - 1 x = length*10 - 1
string = string .. x string = string .. x
else else
for i=1, (length-1) do for i=1, (length-1) do

View file

@ -27,7 +27,7 @@ function ParallaxBackground:new(scene, height, bottomBorder, type)
self.assets:addImage("cliff", backpath .. "-cliff.png") self.assets:addImage("cliff", backpath .. "-cliff.png")
self.texture = {} self.texture = {}
self.texture.floor = self:generateFloor(tile) self.texture.floor = self:generateFloor(datas.tiles)
end end
-- GET FUNCTIONS -- GET FUNCTIONS

View file

@ -54,6 +54,7 @@ function gui.newChoiceBack(approximateWidth)
local iterations = math.floor((approximateWidth / 12) - 4) local iterations = math.floor((approximateWidth / 12) - 4)
local width = (iterations * 12) local width = (iterations * 12)
local height = 16
local canvasWidth = width + 21 + 25 local canvasWidth = width + 21 + 25
local canvas = love.graphics.newCanvas(canvasWidth, height) local canvas = love.graphics.newCanvas(canvasWidth, height)

View file

@ -27,7 +27,7 @@ function ShootMap:updateWidth()
end end
function ShootMap:getLevelData(mapname) function ShootMap:getLevelData(mapname)
local file = file or "testlevel.test1" local file = mapname or "testlevel.test1"
local level = require("datas.gamedata.maps.shoot." .. file) local level = require("datas.gamedata.maps.shoot." .. file)
self.zone = level.datas.zone self.zone = level.datas.zone

View file

@ -18,7 +18,7 @@ function BattleUtils.getCategoryDirectory(directory, lua)
end end
function BattleUtils.getDirectoryLuaStyle(directory) function BattleUtils.getDirectoryLuaStyle(directory)
return REQUIREDIR .. "." .. directory return DIR .. "." .. directory
end end
function BattleUtils.getBattleFromCategory(directory) function BattleUtils.getBattleFromCategory(directory)

View file

@ -178,7 +178,7 @@ end
function Battler:setJump(power, bounceNumber, useDefaultAnimation) function Battler:setJump(power, bounceNumber, useDefaultAnimation)
self.zspeed = power self.zspeed = power
self.jump.spin = spinjump self.jump.spin = (useDefaultAnimation == false)
self.jump.bounceNumber = bounceNumber self.jump.bounceNumber = bounceNumber
self.jump.isJumping = true self.jump.isJumping = true
end end

View file

@ -60,10 +60,10 @@ function FighterParent:sendDamage(target, value, accuracy, isSpecial, isAerial)
core.debug:print("cbs/battler", "Sending " .. value .." damage at " .. target.name) core.debug:print("cbs/battler", "Sending " .. value .." damage at " .. target.name)
target:receiveDamage(value, accuracy, isSpecial, isAerial, fromWho) target:receiveDamage(value, accuracy, isSpecial, isAerial, self)
end end
function FighterParent:receiveDamage(value, accuracy, isSpecial, isAerial) function FighterParent:receiveDamage(value, accuracy, isSpecial, isAerial, fromWho)
local stats = self:getStats() local stats = self:getStats()
if (isSpecial) then if (isSpecial) then
@ -127,7 +127,7 @@ end
function FighterParent:getUniqueIdentificator() function FighterParent:getUniqueIdentificator()
local side = 1 local side = 1
if (isHero == false) then if (self.isHero == false) then
side = -1 side = -1
end end
return self.id * side return self.id * side

View file

@ -81,7 +81,7 @@ function widgets.Switch:new(scene, menu, keyname, label)
self.keyname = keyname self.keyname = keyname
local label2 = self:getLabel() local label2 = self:getLabel()
widgets.Switch.super.new(self, scene, menu, label, label2) widgets.Switch.super.new(self, scene, menu, label, label2)
self.order = order or 0 self.order = 0
end end
function widgets.Switch:modifyKey() function widgets.Switch:modifyKey()