Fix variable_out_of_scope warnings in Arena

master
Nicolas Hake 2018-07-23 12:07:37 +02:00
parent 1bb728b047
commit 1ef6b7a7fc
4 changed files with 19 additions and 18 deletions

View File

@ -164,27 +164,28 @@ global func FxFillBaseChestStart(object target, effect, int temporary, bool supp
return 1; return 1;
effect.supply_type=supply; effect.supply_type=supply;
var w_list;
if(effect.supply_type) if(effect.supply_type)
var w_list = [Firestone, Dynamite, IronBomb, Shovel, Loam, Ropeladder]; w_list = [Firestone, Dynamite, IronBomb, Shovel, Loam, Ropeladder];
else else
var w_list = [Bow, Shield, Sword, Javelin, Blunderbuss, FrostboltScroll]; w_list = [Bow, Shield, Sword, Javelin, Blunderbuss, FrostboltScroll];
for(var i=0; i<5; i++) for(var i=0; i<5; i++)
target->CreateChestContents(w_list[i]); target->CreateChestContents(w_list[i]);
return 1; return 1;
} }
global func FxFillBaseChestTimer(object target, effect) global func FxFillBaseChestTimer(object target, effect)
{ {
var maxcount = []; var maxcount = [], w_list = [];
if(effect.supply_type) if(effect.supply_type)
{ {
var w_list = [Firestone, Dynamite, IronBomb, Shovel, Loam, Ropeladder]; w_list = [Firestone, Dynamite, IronBomb, Shovel, Loam, Ropeladder];
var maxcount = [2,2,1,2,1]; maxcount = [2,2,1,2,1];
} }
else else
{ {
var w_list = [Bow, Shield, Sword, Javelin, Blunderbuss, FrostboltScroll]; w_list = [Bow, Shield, Sword, Javelin, Blunderbuss, FrostboltScroll];
var maxcount = [1,2,1,1,1,2]; maxcount = [1,2,1,1,1,2];
} }
var contents; var contents;

View File

@ -150,25 +150,27 @@ global func FxFillBaseChestStart(object target, effect, int temporary, bool supp
return 1; return 1;
effect.supply_type=supply; effect.supply_type=supply;
var w_list;
if(effect.supply_type) if(effect.supply_type)
var w_list = [Firestone, Dynamite, Ropeladder, ShieldGem]; w_list = [Firestone, Dynamite, Ropeladder, ShieldGem];
else else
var w_list = [Bow, Sword, Javelin, PyreGem]; w_list = [Bow, Sword, Javelin, PyreGem];
for(var i=0; i<4; i++) for(var i=0; i<4; i++)
target->CreateChestContents(w_list[i]); target->CreateChestContents(w_list[i]);
return 1; return 1;
} }
global func FxFillBaseChestTimer(object target, effect) global func FxFillBaseChestTimer(object target, effect)
{ {
var w_list, maxcount;
if(effect.supply_type) if(effect.supply_type)
{ {
var w_list = [Firestone, Dynamite, Shovel, Loam, Ropeladder, SlowGem, ShieldGem]; w_list = [Firestone, Dynamite, Shovel, Loam, Ropeladder, SlowGem, ShieldGem];
var maxcount = [2,2,1,2,1,2,1]; maxcount = [2,2,1,2,1,2,1];
} }
else else
{ {
var w_list = [Sword, Javelin, Blunderbuss, ShieldGem, PyreGem]; w_list = [Sword, Javelin, Blunderbuss, ShieldGem, PyreGem];
var maxcount = [1,2,1,1,1]; maxcount = [1,2,1,1,1];
} }
var contents; var contents;

View File

@ -97,6 +97,7 @@ func InitPlayerRound(int plr, object crew) // called by Goal_MultiRoundMelee
crew->SetAction("Ride", balloon); crew->SetAction("Ride", balloon);
balloon->SetSpeed(0,0); balloon->SetSpeed(0,0);
crew->SetSpeed(0,0); crew->SetSpeed(0,0);
balloon->CreateEffect(IntNoGravity, 1, 1);
} }
// initial material // initial material
if (SCENPAR_Weapons == 0) if (SCENPAR_Weapons == 0)
@ -129,9 +130,6 @@ func InitPlayerRound(int plr, object crew) // called by Goal_MultiRoundMelee
} }
crew.MaxEnergy = 100000; crew.MaxEnergy = 100000;
crew->DoEnergy(1000); crew->DoEnergy(1000);
if (SCENPAR_SpawnType == 1 && balloon)
balloon->CreateEffect(IntNoGravity, 1, 1);
} }
func StartRound() // called by Goal_MultiRoundMelee func StartRound() // called by Goal_MultiRoundMelee

View File

@ -99,10 +99,10 @@ global func FxThunderStrikeTimer(pTarget, effect, iEffectTime)
{ {
if(iEffectTime%3) if(iEffectTime%3)
{ {
for (var y = 0; !GBackSolid(x+move+5,y) && y < LandscapeHeight(); y += Random(4) + 3) for (var y = 0; !GBackSolid(move+5,y) && y < LandscapeHeight(); y += Random(4) + 3)
{ {
var add=Random((iEffectTime*5))*((Random(2)*2) -1); var add=Random((iEffectTime*5))*((Random(2)*2) -1);
CreateParticle("Air", x+move+5+add, y, PV_Random(-2, 2), PV_Random(-10, -5), PV_Random(5, 20), effect.particles_air); CreateParticle("Air", move+5+add, y, PV_Random(-2, 2), PV_Random(-10, -5), PV_Random(5, 20), effect.particles_air);
} }
} }
} }