"My map worked on westfall but not on 1.24"

Terrabull

Veteran Member (Done that)
Reaction score
38
Ummm, doesn't this kinda break every GUI made map as well?

EDIT: Nevermind Cleez's post answers my questions (assuming the examples below it are all valid.
 

cleeezzz

The Undead Ranger.
Reaction score
268
Another update, If you use a return in ANY of the IF BLOCKS OR ELSEIF BLOCKS (excluding the last ELSEIF block) then the last ELSEIF must return.

JASS:
function Hi takes integer i returns real  // DOES NOT WORK
    local real r
    if i > 1 then
        set r = 5
    elseif i > 2 then
        set r = 6.
        return r
    elseif i > 3 then
        set r = 6.
    elseif i > 4 then
        set r = 7.
    endif
    return 0.
endfunction


JASS:
function Hi takes integer i returns real  // WORKS
    local real r
    if i > 1 then
        set r = 5
    elseif i > 2 then
        set r = 6.
        return r
    elseif i > 3 then
        set r = 6.
    elseif i > 4 then
        set r = 7.
        return r
    endif
    return 0.
endfunction


BTW: these only show what will LOAD the map, it will still probably Critical error after map loads.
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
I and Gwypaas tested the usage of DoNothing, and what'dyaknow, it worked.
 

cleeezzz

The Undead Ranger.
Reaction score
268
? whats the code you used to test DoNothing? (you mean to make the return bug?)
 

cleeezzz

The Undead Ranger.
Reaction score
268
glad your systems didn't break but the codes/spells that use your systems probably broke XD
 

Sevion

The DIY Ninja
Reaction score
413
Um. I don't know about you guys, but this works:

JASS:
function Hi takes integer i returns real
if i > 1 then
    return 5.
elseif i > 2 then
endif
return 9999999.
endfunction


I tested multiple times.

Edit: Didn't update via East/West. I used Westfall 1.24.

>_<

I'm going through trouble to update right now. Edit w/ results.
 

Nestharus

o-o
Reaction score
84
rofl, I just think this is rich

JASS:
scope testla initializer ini
    private function I2U takes integer i returns unit
        return i
        call DoNothing()
        return null
    endfunction
    
    private function start takes nothing returns nothing
        local unit u = CreateUnit(Player(0), &#039;hpea&#039;, 0, 0, 270)
        call TriggerSleepAction(5)
        call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, &quot;Removing Unit &quot; + GetUnitName(I2U(GetHandleId(u))))
        call RemoveUnit(I2U(GetHandleId(u)))
    endfunction
    
    private function ini takes nothing returns nothing
        call TriggerAddAction(Mfn_ini, function start)
    endfunction
endscope


But at least this doesn't work anymore, so we don't have to worry about virus maps
JASS:
scope testla initializer ini
    globals
        private constant trigger myCode = CreateTrigger()
    endglobals
    
    private function Code2Int takes code c returns integer
        return c
        call DoNothing()
        return 0
    endfunction
    
    private function Int2Code takes integer i returns code
        return i
        call DoNothing()
        return null
    endfunction
    
    private function displaySomeText takes nothing returns nothing
        call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, &quot;Hello World&quot;)
    endfunction
    
    private function start takes nothing returns nothing
        call TriggerAddAction(myCode, Int2Code(Code2Int(function displaySomeText)))
        call TriggerExecute(myCode)
    endfunction
    
    private function ini takes nothing returns nothing
        call TriggerAddAction(Mfn_ini, function start)
    endfunction
endscope


That compiles but it doesn't do anything in-game :|
 

Jesus4Lyf

Good Idea™
Reaction score
397
Nestharus, I'm at work. Try this:
JASS:
scope testla initializer ini
    globals
        private constant trigger myCode = CreateTrigger()
    endglobals
    
    private function Code2Int takes code c returns integer
        return c
        call DoNothing()
        return 0
    endfunction
    
    private function Int2Code takes integer i returns code
        return i
        call DoNothing()
        return null
    endfunction

private function c2c takes code c returns code
return c
// So that JassHelper doesn&#039;t inline this...
call DoNothing()
return c
endfunction
    
    private function displaySomeText takes nothing returns nothing
        call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, &quot;Hello World&quot;)
    endfunction

private function dothings takes trigger t, code f returns nothing
call TriggerAddAction(t,f)
call DoNothing() // no inline
endfunction
    
    private function start takes nothing returns nothing
local code f=c2c(Int2Code(Code2Int(function displaySomeText)))
        call dothings(myCode, f)
        call TriggerExecute(myCode)
    endfunction
    
    private function ini takes nothing returns nothing
        call TriggerAddAction(Mfn_ini, function start)
    endfunction
endscope
 

SwedishChef

New Member
Reaction score
32
I dont understand I use zero jass in my two maps, but i use newgen and egui. Might it be any of the added triggers by egui or newgen that is causing my bugs to freak out??
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
So wait, if i've understood all your tests, test if the map is loading is not enough ?
We have to test the code if it doesn't crash war3 when it is executed ?!

Also i just want to point out that you need to test it with debug mode "on" and "off" (ofc if you use vJass), because sometimes it does matter.
 

MasterOfRa

New Member
Reaction score
10
1.24 Broke 99.99% of all resources.

i didn't know there were 10000 resources , i fixed my map, though it still doesn't completely work, but blizzard needs to simply make the compiler look at all return statements, and see if they return the correct type, wouldn't that work better?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top