Return bug

lmjai

New Member
Reaction score
1
Hi, I tried to ressurrect a 5 yr. old map and after asking in some forum I realised I can't do it without knowing a bit of coding. It seems there isn't an "easy formula" to fix the return bugs.

The map only has 1 return bug (i think) and is the following:
JASS:
function C9 takes unit da,integer dA returns integer
local integer db
local item dB
set db=0
loop
set dB=UnitItemInSlot(da,db)
if(dB!=null)and(GetItemTypeId(dB)==dA)then
set dB=null
return db+1
endif
set db=db+1
exitwhen db>=6
endloop
set dB=null
return 0
endfunction



Well, questions:
Can someone fix it for me? or
Where can I start looking for a solution?
 

Laiev

Hey Listen!!
Reaction score
188

lmjai

New Member
Reaction score
1
I don't get it, there arent any functins as simple as those in the script, still the game won't load.

JASS:
function dc takes unit da,integer dA returns item
local integer db=C9(da,dA)
if(db==0)then
return null
else
return UnitItemInSlot(da,db-1)
endif
endfunction

JASS:
function DT takes unit Du,integer DU returns item
local item Dv
if(DU==-1)then
return null
endif
set Dv=CreateItem(DU,GetUnitX(Du)+GetRandomReal(-32,32),GetUnitY(Du)+GetRandomReal(-32,32))
call SetItemDropID(Dv,GetUnitTypeId(Du))
call UpdateStockAvailability(Dv)
set C2=Dv
set Dv=null
return C2
endfunction


May it be one if these? I am using http://jass.sourceforge.net/doc/retbug.shtml as a search pattern ("return 0" "return null")
 

Laiev

Hey Listen!!
Reaction score
188
are you using vanilla editor ou newgen?

also, check the map header (the top script of everything)

JASS:
function dc takes unit da,integer dA returns item
    local integer db=C9(da,dA)
    if(db==0)then
        return null
    else
        return UnitItemInSlot(da,db-1)
    endif
endfunction



JASS:
function DT takes unit Du,integer DU returns item
    local item Dv
    if(DU==-1)then
        return null
    endif
    set Dv=CreateItem(DU,GetUnitX(Du)+GetRandomReal(-32,32),GetUnitY(Du)+GetRandomReal(-32,32))
    call SetItemDropID(Dv,GetUnitTypeId(Du))
    call UpdateStockAvailability(Dv)
    set C2=Dv
    set Dv=null
    return C2
endfunction
 

lmjai

New Member
Reaction score
1
The map was protected, I had to get it deprotected, then extract war3map.j, then opened with jasscraft.
At the top there are just a bunch of globals.
I copied the first function after all that stuff, don't know if that is the header or not.

JASS:
globals
timerdialog a=null
force A
force B
integer c=0
timer C=CreateTimer()
dialog D
integer array e
integer array E
dialog F
dialog G
button array h
dialog array H
button array I
integer j=0
unit J=null
integer array k
dialog array K
button array l
dialog L
button array m
integer M=0
unit array n
boolean array N
integer o=0
group O=CreateGroup()
integer array P
timer q=CreateTimer()
timerdialog Q=null
timer R=CreateTimer()
player s=null
player S=null
unit array T
integer array U
dialog V
button array w
unit array W
group array X
player Y=null
dialog array z
button array Z
unit aa=null
force aA=CreateForce()
boolean array ab
integer array aB
string array ac
integer array aC
multiboard ad=null
player array aD
effect array ae
timer aE=CreateTimer()
timerdialog af=null
integer array aF
unit array ag
boolean array aG
location array ah
item array aH
group array ai
group aI=CreateGroup()
group aj=CreateGroup()
multiboard aJ=null
group ak=CreateGroup()
player aK=null
multiboard al=null
string array aL
string array am
string array aM
location an=null
location aN=null
effect ao=null
location array aO
dialog ap
button array aP
boolean array aq
button array aQ
button array ar
group array aR
unit array as
real array aS
boolean array at
boolean array aT
integer array au
boolean array aU
rect av
rect aV
rect aw
rect aW
rect ax
rect aX
rect ay
rect aY
rect az
rect aZ
rect a0
rect a1
rect a2
rect a3
rect a4
rect a5
rect a6
rect a7
rect a8
rect a9
camerasetup Aa=CreateCameraSetup()
camerasetup AA=CreateCameraSetup()
sound Ab
sound AB
sound Ac
sound AC
sound Ad
sound AD
sound Ae
sound AE
sound Af
sound AF
sound Ag
sound AG
sound Ah
sound AH
sound Ai
sound AI
sound Aj
sound AJ
sound Ak
sound AK
trigger Al=CreateTrigger()
trigger AL=CreateTrigger()
trigger Am=CreateTrigger()
trigger AM=CreateTrigger()
trigger An=CreateTrigger()
trigger AN=CreateTrigger()
trigger Ao=CreateTrigger()
trigger AO=CreateTrigger()
trigger Ap=CreateTrigger()
trigger AP=CreateTrigger()
trigger Aq=CreateTrigger()
trigger AQ=CreateTrigger()
trigger Ar=CreateTrigger()
trigger AR=CreateTrigger()
trigger As=CreateTrigger()
trigger AS=CreateTrigger()
trigger At=CreateTrigger()
trigger AT=CreateTrigger()
trigger Au=CreateTrigger()
trigger AU=CreateTrigger()
trigger Av=CreateTrigger()
trigger AV=CreateTrigger()
trigger Aw=CreateTrigger()
trigger AW=CreateTrigger()
trigger Ax=CreateTrigger()
trigger AX=CreateTrigger()
trigger Ay=CreateTrigger()
trigger AY=CreateTrigger()
trigger Az=CreateTrigger()
trigger AZ=CreateTrigger()
trigger A0=CreateTrigger()
trigger A1=CreateTrigger()
trigger A2=CreateTrigger()
trigger A3=CreateTrigger()
trigger A4=CreateTrigger()
trigger A5=CreateTrigger()
trigger A6=CreateTrigger()
trigger A7=CreateTrigger()
trigger A8=CreateTrigger()
trigger A9=CreateTrigger()
trigger ba=CreateTrigger()
trigger bA=CreateTrigger()
trigger bb=CreateTrigger()
trigger bB=CreateTrigger()
trigger bc=CreateTrigger()
trigger bC=CreateTrigger()
trigger bd=CreateTrigger()
trigger bD=CreateTrigger()
trigger be=CreateTrigger()
trigger bE=CreateTrigger()
trigger bf=CreateTrigger()
trigger bF=CreateTrigger()
trigger bg=CreateTrigger()
trigger bG=CreateTrigger()
trigger bh=CreateTrigger()
trigger bH=CreateTrigger()
trigger bi=CreateTrigger()
trigger bI=CreateTrigger()
trigger bj=CreateTrigger()
trigger bJ=CreateTrigger()
trigger bk=CreateTrigger()
trigger bK=CreateTrigger()
trigger bl=CreateTrigger()
trigger bL=CreateTrigger()
trigger bm=CreateTrigger()
trigger bM=CreateTrigger()
trigger bn=CreateTrigger()
trigger bN=CreateTrigger()
trigger bo=CreateTrigger()
trigger bO=CreateTrigger()
trigger bp=CreateTrigger()
trigger bP=CreateTrigger()
trigger bq=CreateTrigger()
trigger bQ=CreateTrigger()
trigger br=CreateTrigger()
trigger bR=CreateTrigger()
trigger bs=CreateTrigger()
trigger bS=CreateTrigger()
trigger bt=CreateTrigger()
trigger bT=CreateTrigger()
trigger bu=CreateTrigger()
trigger bU=CreateTrigger()
trigger bv=CreateTrigger()
trigger bV=CreateTrigger()
trigger bw=CreateTrigger()
trigger bW=CreateTrigger()
trigger bx=CreateTrigger()
trigger bX=CreateTrigger()
trigger by=CreateTrigger()
trigger bY=CreateTrigger()
trigger bz=CreateTrigger()
trigger bZ=CreateTrigger()
trigger b0=CreateTrigger()
trigger b1=CreateTrigger()
trigger b2=CreateTrigger()
trigger b3=CreateTrigger()
trigger b4=CreateTrigger()
trigger b5=CreateTrigger()
trigger b6=CreateTrigger()
trigger b7=CreateTrigger()
trigger b8=CreateTrigger()
trigger b9=CreateTrigger()
trigger Ba=CreateTrigger()
trigger BA=CreateTrigger()
trigger Bb=CreateTrigger()
trigger BB=CreateTrigger()
trigger Bc=CreateTrigger()
trigger BC=CreateTrigger()
trigger Bd=CreateTrigger()
trigger BD=CreateTrigger()
trigger Be=CreateTrigger()
trigger BE=CreateTrigger()
trigger Bf=CreateTrigger()
trigger BF=CreateTrigger()
trigger Bg=CreateTrigger()
trigger BG=CreateTrigger()
trigger Bh=CreateTrigger()
trigger BH=CreateTrigger()
trigger Bi=CreateTrigger()
trigger BI=CreateTrigger()
trigger Bj=CreateTrigger()
trigger BJ=CreateTrigger()
trigger Bk=CreateTrigger()
trigger BK=CreateTrigger()
trigger Bl=CreateTrigger()
trigger BL=CreateTrigger()
trigger Bm=CreateTrigger()
trigger BM=CreateTrigger()
trigger Bn=CreateTrigger()
trigger BN=CreateTrigger()
trigger Bo=CreateTrigger()
trigger BO=CreateTrigger()
trigger Bp=CreateTrigger()
trigger BP=CreateTrigger()
trigger Bq=CreateTrigger()
trigger BQ=CreateTrigger()
trigger Br=CreateTrigger()
trigger BR=CreateTrigger()
trigger Bs=CreateTrigger()
trigger BS=CreateTrigger()
trigger Bt=CreateTrigger()
trigger BT=CreateTrigger()
trigger Bu=CreateTrigger()
trigger BU=CreateTrigger()
trigger Bv=CreateTrigger()
trigger BV=CreateTrigger()
trigger Bw=CreateTrigger()
trigger BW=CreateTrigger()
trigger Bx=CreateTrigger()
trigger BX=CreateTrigger()
trigger By=CreateTrigger()
trigger BY=CreateTrigger()
trigger Bz=CreateTrigger()
trigger BZ=CreateTrigger()
trigger B0=CreateTrigger()
trigger B1=CreateTrigger()
trigger B2=CreateTrigger()
trigger B3=CreateTrigger()
trigger B4=CreateTrigger()
trigger B5=CreateTrigger()
trigger B6=CreateTrigger()
trigger B7=CreateTrigger()
trigger B8=CreateTrigger()
trigger B9=CreateTrigger()
trigger ca=CreateTrigger()
trigger cA=CreateTrigger()
trigger cb=CreateTrigger()
trigger cB=CreateTrigger()
trigger cc=CreateTrigger()
trigger cC=CreateTrigger()
trigger cd=CreateTrigger()
trigger cD=CreateTrigger()
trigger ce=CreateTrigger()
trigger cE=CreateTrigger()
trigger cf=CreateTrigger()
trigger cF=CreateTrigger()
trigger cg=CreateTrigger()
trigger cG=CreateTrigger()
trigger ch=CreateTrigger()
trigger cH=CreateTrigger()
trigger ci=CreateTrigger()
trigger cI=CreateTrigger()
trigger cj=CreateTrigger()
trigger cJ=CreateTrigger()
trigger ck=CreateTrigger()
trigger cK=CreateTrigger()
trigger cl=CreateTrigger()
trigger cL=CreateTrigger()
trigger cm=CreateTrigger()
trigger cM=CreateTrigger()
trigger cn=CreateTrigger()
trigger cN=CreateTrigger()
trigger co=CreateTrigger()
trigger cO=CreateTrigger()
trigger cp=CreateTrigger()
trigger cP=CreateTrigger()
trigger cq=CreateTrigger()
trigger cQ=CreateTrigger()
trigger cr=CreateTrigger()
trigger cR=CreateTrigger()
trigger cs=CreateTrigger()
trigger cS=CreateTrigger()
trigger ct=CreateTrigger()
trigger cT=CreateTrigger()
trigger cu=CreateTrigger()
trigger cU=CreateTrigger()
trigger cv=CreateTrigger()
trigger cV=CreateTrigger()
trigger cw=CreateTrigger()
trigger cW=CreateTrigger()
trigger cx=CreateTrigger()
trigger cX=CreateTrigger()
trigger cy=CreateTrigger()
trigger cY=CreateTrigger()
trigger cz=CreateTrigger()
trigger cZ=CreateTrigger()
trigger c0=CreateTrigger()
trigger c1=CreateTrigger()
trigger c2=CreateTrigger()
trigger c3=CreateTrigger()
trigger c4=CreateTrigger()
trigger c5=CreateTrigger()
trigger c6=CreateTrigger()
trigger c7=CreateTrigger()
trigger c8=CreateTrigger()
trigger c9=CreateTrigger()
trigger Ca=CreateTrigger()
trigger CA=CreateTrigger()
trigger Cb=CreateTrigger()
trigger CB=CreateTrigger()
trigger Cc=CreateTrigger()
trigger CC=CreateTrigger()
trigger Cd=CreateTrigger()
trigger CD=CreateTrigger()
trigger Ce=CreateTrigger()
trigger CE=CreateTrigger()
trigger Cf=CreateTrigger()
trigger CF=CreateTrigger()
trigger Cg=CreateTrigger()
trigger CG=CreateTrigger()
trigger Ch=CreateTrigger()
trigger CH=CreateTrigger()
trigger Ci=CreateTrigger()
trigger CI=CreateTrigger()
trigger Cj=CreateTrigger()
trigger CJ=CreateTrigger()
trigger Ck=CreateTrigger()
trigger CK=CreateTrigger()
trigger Cl=CreateTrigger()
trigger CL=CreateTrigger()
trigger Cm=CreateTrigger()
trigger CM=CreateTrigger()
trigger Cn=CreateTrigger()
trigger CN=CreateTrigger()
trigger Co=CreateTrigger()
trigger CO=CreateTrigger()
trigger Cp=CreateTrigger()
trigger CP=CreateTrigger()
trigger Cq=CreateTrigger()
trigger CQ=CreateTrigger()
trigger Cr=CreateTrigger()
trigger CR=CreateTrigger()
trigger Cs=CreateTrigger()
trigger CS=CreateTrigger()
trigger Ct=CreateTrigger()
trigger CT=CreateTrigger()
trigger Cu=CreateTrigger()
trigger CU=CreateTrigger()
trigger Cv=CreateTrigger()
trigger CV=CreateTrigger()
trigger Cw=CreateTrigger()
trigger CW=CreateTrigger()
trigger Cx=CreateTrigger()
trigger CX=CreateTrigger()
trigger Cy=CreateTrigger()
trigger CY=CreateTrigger()
trigger Cz=CreateTrigger()
unit CZ
unit C0
timer C1=null
handle C2
endglobals


JASS:
function C3 takes real C4 returns nothing
local real C5
local real st=TimerGetElapsed(C1)
if st<=0 then
set C1=CreateTimer()
call TimerStart(C1,0xF4240,false,null)
endif
if(C4>0)then
loop
set C5=C4-TimerGetElapsed(C1)+st
exitwhen C5<=0
if(C5>bj_POLLED_WAIT_SKIP_THRESHOLD)then
call TriggerSleepAction(.1*C5)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
endif
endfunction


Here is the war3map.j anyway
 

Attachments

  • war3map.zip
    49.7 KB · Views: 234

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Yep, open-deprotecting is restricted here, I guess you haven't read the forum's rule.
Take your time to read it. :)
 

lmjai

New Member
Reaction score
1
I read it before posting, but I am not asking support to deprotect a map, I am asking for support to make it work in the new version of wc3. Also the maker of the map dissapeared in 2007 and didn't even leave an e-mail address so I think it's good.
 

the Immortal

I know, I know...
Reaction score
51
I have no idea what could be wrong in it, although I can't be bothered to check all of the scripts. But simple "return null/0" search didn't show anything so it seems not be return bug. I suppose it may be something changed in object data, but I am not that good with this material.


PS. I really hope this thread doesn't get locked, as imho this case neither is nor should be what that "no deprotecting" rule is about.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
I read it before posting, but I am not asking support to deprotect a map, I am asking for support to make it work in the new version of wc3. Also the maker of the map dissapeared in 2007 and didn't even leave an e-mail address so I think it's good.
Remake the map from scratch? :)
 

lmjai

New Member
Reaction score
1
JASS:
function Dm takes nothing returns nothing
local integer db
set db=0
loop
if(GetPlayerController(Player(db))==MAP_CONTROL_RESCUABLE)then
call Dl()
return   //is this right?
endif
set db=db+1
exitwhen db==12
endloop
endfunction

JASS:
timerdialog a=null    //I read something about bug with timer also(?)


The map is Crazy's Vampirism, can be found in http://www.mutedvision.net/maps/

I already found a working version of it googling a lot, I'd like to find out wtf is wrong with this one anyways.

EDIT: That working version i found doesn't work
 

Laiev

Hey Listen!!
Reaction score
188
yes, this is right...

when you return nothing to a function, you can only stop this function calling return with no argument
 

Jesus4Lyf

Good Idea™
Reaction score
397
The moderators are content with making the map work with the latest version of Warcraft III, so long as that is all that is being done, and deprotection is not discussed.

IE. We're happy to let people discuss fixing the return bug, or the globals/locals shadow bug, or whatever else Blizzard broke. This thread is about helping to fix that. Keep it that way. ;)

You should look into the globals/locals shadowing bug, it may be the reason the map doesn't run, as opposed to the return bug. :thup:
 

Lehona

New Member
Reaction score
12
Isn't it just about "false positives" or are they already properly fixed? The statement "return" two times in a function already caused Warcraft to be not abled to start the map, if I remember correctly.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Isn't it just about "false positives" or are they already properly fixed? The statement "return" two times in a function already caused Warcraft to be not abled to start the map, if I remember correctly.
It was more complex than that, and has been fixed since.
Returning the incorrect type will now cause a map to fail to load. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top