Fix suspicious_assignment warnings in Arena

master
Nicolas Hake 2018-07-23 10:44:42 +02:00
parent 8950db9cb4
commit c3ef039872
2 changed files with 17 additions and 9 deletions

View File

@ -42,11 +42,11 @@ func InitTheme()
if (theme == 0) // Random Ice if (theme == 0) // Random Ice
theme = 1 + Random(3); theme = 1 + Random(3);
if (theme == 1) // Hot Ice if (theme == 1) // Hot Ice
return g_theme = HotIce; g_theme = HotIce;
if (theme == 2) // Miami Ice else if (theme == 2) // Miami Ice
return g_theme = MiamiIce; g_theme = MiamiIce;
if (theme == 3) // Eci Toh else if (theme == 3) // Eci Toh
return g_theme = EciToh; g_theme = EciToh;
} }
func SpawnPositionCount() func SpawnPositionCount()

View File

@ -14,7 +14,9 @@ func InitializeRound() // called by Goal_MultiRoundMelee
// Chests in regular mode. Boom packs in grenade launcher mode. // Chests in regular mode. Boom packs in grenade launcher mode.
var num_extras = [6,12][SCENPAR_Weapons]; var num_extras = [6,12][SCENPAR_Weapons];
for (i=0; i<num_extras; ++i) for (i=0; i<num_extras; ++i)
if (pos=FindLocation(Loc_InRect(0,chest_area_y,ls_wdt,chest_area_hgt-100), Loc_Wall(CNAT_Bottom))) // Loc_Wall adds us 100 pixels... {
var pos = FindLocation(Loc_InRect(0,chest_area_y,ls_wdt,chest_area_hgt-100), Loc_Wall(CNAT_Bottom)); // Loc_Wall adds us 100 pixels...
if (pos)
{ {
if (SCENPAR_Weapons == 0) if (SCENPAR_Weapons == 0)
{ {
@ -32,19 +34,25 @@ func InitializeRound() // called by Goal_MultiRoundMelee
} }
else else
{ {
var boompack= CreateObjectAbove(Boompack,pos.x,pos.y); var boompack = CreateObjectAbove(Boompack,pos.x,pos.y);
} }
} }
// Materials: Firestones // Materials: Firestones
for (i=0; i<30; ++i) for (i=0; i<30; ++i)
if (pos=FindLocation(Loc_InRect(0,chest_area_y,ls_wdt,chest_area_hgt), Loc_Solid())) {
var pos = FindLocation(Loc_InRect(0,chest_area_y,ls_wdt,chest_area_hgt), Loc_Solid());
if (pos)
if (IsFirestoneSpot(pos.x,pos.y)) if (IsFirestoneSpot(pos.x,pos.y))
CreateObjectAbove(Firestone,pos.x,pos.y-1); CreateObjectAbove(Firestone,pos.x,pos.y-1);
}
// Some firestones and bombs in lower half. For ap type 1, more firestones in lower than upper half. // Some firestones and bombs in lower half. For ap type 1, more firestones in lower than upper half.
for (i=0; i<30; ++i) for (i=0; i<30; ++i)
if (pos=FindLocation(Loc_InRect(0,ls_hgt/2,ls_wdt,ls_hgt/3), Loc_Solid())) {
var pos = FindLocation(Loc_InRect(0,ls_hgt/2,ls_wdt,ls_hgt/3), Loc_Solid());
if (pos)
if (IsFirestoneSpot(pos.x,pos.y)) if (IsFirestoneSpot(pos.x,pos.y))
CreateObjectAbove([Firestone,IronBomb][Random(Random(3))],pos.x,pos.y-1); CreateObjectAbove([Firestone,IronBomb][Random(Random(3))],pos.x,pos.y-1);
}
SetSky(g_theme.Sky); SetSky(g_theme.Sky);
g_theme->InitializeRound(); g_theme->InitializeRound();