HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS: Whats wrong with this?

10-25-2006, 12:22 PM#1
Fulla
Quick brief explanation what this is for:

For a card game type map, where you have rects you can summon your 'creatures; to.
It checks 1by1 if a rect is occupied then moves to next

Heres condition I had

Collapse JASS:
function Trig_Summon_Check takes nothing returns integer
    if CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[1])) == 0 then
        return 1
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[2])) == 0 then
        return 2
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[3])) == 0 then
        return 3
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[4])) == 0 then
        return 4    
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[5])) == 0 then
        return 5    
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[6])) == 0 then
        return 6    
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[7])) == 0 then
        return 7    
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[8])) == 0 then
        return 8    
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[9])) == 0 then
        return 9    
    elseif CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[10])) == 0 then
        return 10    
endfunction

Collapse JASS:
local integer d = Trig_Summon_Check()
10-25-2006, 12:28 PM#2
Captain Griffen
No endif. And it leaks groups like hell.
10-25-2006, 12:35 PM#3
Fulla
hmm added endif still get the problem :-(

Collapse JASS:
    if CountUnitsInGroup(GetUnitsInRectAll(P_ArenaA1[1])) == 0 then

expected a name.
10-25-2006, 12:39 PM#4
Vexorian
Maybe P_ArenaA1 lacks an udg_ ?
10-25-2006, 12:46 PM#5
Fulla
aha yea, damn I still make these noob mistakes.

thx
10-25-2006, 01:36 PM#6
MaD[Lion]
well sorry to say but then ur still noob ;)
Don't think complex before u have mastered the basics