Remove calls to GetVisualGearValues where it's not needed
authorWuzzy <Wuzzy2@mail.ru>
Tue, 21 Aug 2018 22:52:46 +0200
changeset 13685 09ea1faf97ca
parent 13684 739fd039daaa
child 13686 3651c63f3c84
Remove calls to GetVisualGearValues where it's not needed
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua
share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Tue Aug 21 22:31:50 2018 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Tue Aug 21 22:52:46 2018 +0200
@@ -183,9 +183,8 @@
 	local y = GetY(gear) + 32 * i
 	local vgear = AddVisualGear(x, y, vgtAmmo, 0, true)
 	if vgear ~= nil then
-		local vgtX,vgtY,vgtdX,vgtdY,vgtAngle,vgtFrame,vgtFrameTicks,vgtState,vgtTimer,vgtTint = GetVisualGearValues(vgear)
 		local vgtFrame = ammoType
-		SetVisualGearValues(vgear,vgtX,vgtY,vgtdX,vgtdY,vgtAngle,vgtFrame,vgtFrameTicks,vgtState,vgtTimer,vgtTint)
+		SetVisualGearValues(vgear,nil,nil,nil,nil,nil,vgtFrame)
 	end
 end
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Tue Aug 21 22:31:50 2018 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Tue Aug 21 22:52:46 2018 +0200
@@ -194,7 +194,6 @@
 
 		local x,y,color
 		local vgear
-		local vgtX, vgtY, vgtdX, vgtdY, vgtAngle, vgtFrame, vgtFrameTicks, vgtState, vgtTimer, vgtTint
 		local dspl = IsHogLocal(CurrentHedgehog)
 		local ammolist = ''
 
@@ -225,9 +224,8 @@
 					y = y + 32
 					vgear = AddVisualGear(x, y, vgtAmmo, 0, true)
 					if vgear ~= nil then
-						vgtX,vgtY,vgtdX,vgtdY,vgtAngle,vgtFrame,vgtFrameTicks,vgtState,vgtTimer,vgtTint = GetVisualGearValues(vgear)
-						vgtFrame = w
-						SetVisualGearValues(vgear,vgtX,vgtY,vgtdX,vgtdY,vgtAngle,vgtFrame,vgtFrameTicks,vgtState,vgtTimer,vgtTint)
+						local vgtFrame = w
+						SetVisualGearValues(vgear,nil,nil,nil,nil,nil,vgtFrame)
 					end
 				end
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Tue Aug 21 22:31:50 2018 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Tue Aug 21 22:52:46 2018 +0200
@@ -294,8 +294,7 @@
         for i = 0, #hhs do
             if circles[hhs[i]] ~= nil and hhs[i]~= nil then
                 hhx, hhy = GetGearPosition(hhs[i])
-                X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint = GetVisualGearValues(circles[hhs[i]])
-                SetVisualGearValues(circles[hhs[i]], hhx + 1, hhy - 3, 0, 0, 0, 0, 0, 40 - (circleFrame % 25), Timer, Tint)
+                SetVisualGearValues(circles[hhs[i]], hhx + 1, hhy - 3, 0, 0, 0, 0, 0, 40 - (circleFrame % 25))
             end
         end
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Tue Aug 21 22:31:50 2018 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Tue Aug 21 22:52:46 2018 +0200
@@ -612,9 +612,8 @@
 
                 fastIndex = fastIndex + 1
 
-                tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false)
-                g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
-                SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour )
+                local tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false)
+                SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, fastColour )
 
         end
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua	Tue Aug 21 22:31:50 2018 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua	Tue Aug 21 22:52:46 2018 +0200
@@ -310,7 +310,6 @@
 
 	DeleteVisualGear(vTag[i])
 	vTag[i] = AddVisualGear(0, 0, vgtHealthTag, 0, false)
-	g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(vTag[i])
 	SetVisualGearValues	(
 				vTag[i], 		--id
 				-(ScreenWidth/2) + xOffset,	--xoffset
@@ -319,7 +318,7 @@
 				0, 			--dy
 				zoomL, 			--zoom
 				1, 			--~= 0 means align to screen
-				g7, 			--frameticks
+				nil, 			--frameticks
 				tValue, 		--value
 				240000, 		--timer
 				tCol		--GetClanColor( GetHogClan(CurrentHedgehog) )
@@ -682,13 +681,13 @@
 		gear = AddGear(100, 100, gtExplosives, 0, 0, 0, 0)
 		SetHealth(gear, 100)
 		if FindPlace(gear, false, 0, LAND_WIDTH, false) ~= nil then
-			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+			AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
 		end
 	end
 	for i = 0, mineSpawn-1 do
 		gear = AddGear(100, 100, gtMine, 0, 0, 0, 0)
 		if FindPlace(gear, false, 0, LAND_WIDTH, false) ~= nil then
-			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+			AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
 		end
 	end
 
@@ -781,9 +780,8 @@
 			---------------
 			-- the trail lets you know you have 5s left to pilot, akin to birdy feathers
 			if (TimeLeft <= 5) and (TimeLeft > 0) then
-				tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
-				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
-				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, GetClanColor(GetHogClan(CurrentHedgehog)) )
+				local tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
+				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, GetClanColor(GetHogClan(CurrentHedgehog)) )
 			end
 			--------------
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Tue Aug 21 22:31:50 2018 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Tue Aug 21 22:52:46 2018 +0200
@@ -882,7 +882,7 @@
 function WallHit(id, zXMin,zYMin, zWidth, zHeight)
 
 	if wTouched[id] == false then
-		tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
+		AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
 		PlaySound(sndExplosion)
 		wallsLeft = wallsLeft - 1
 
@@ -900,7 +900,7 @@
 
 	wTouched[id] = true
 	if #wTouched > 0 then
-		tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
+		AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
 	end
 
 end
@@ -925,10 +925,7 @@
 		local eY = zYMin + GetRandom(zHeight+10)
 
 		local tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
-		if tempE ~= 0 then
-			local g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
-			SetVisualGearValues(tempE, eX, eY, g3, g4, g5, g6, g7, 1, g9, bCol )
-		end
+		SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, 1, nil, bCol )
 	end
 
 end