- Joined
- Dec 12, 2011
- Messages
- 116
Hey guys, I found something really weird and buggy today, that took me one hour to reduce until I got to this.
So, let me explain to you wtf is going on.
(The test map is attached)
I have two triggers:
Well, the fact is: This way everything works perfectly. The messages are displayed properly.
BUT, try disabling the "Set u = Paladin 0000 <gen>" action. Yes, disabling. It could be deleting as well, but you can just disable it to see what happens. And yes, when it's enabled, you still keep the "if false" thing.
Disable it and test the map again.
Wherever the unit is, the displayed messages will be 2 and 3!!! WTF!!
Putting something inside an "if false" statement, getting different results? WTF guys?
Could anyone think in something about this?
Since today, I will always set my preplaced units to dummy variables inside an "if false" statement. Or, better, I will never use generated variables anymore.
If you couldn't recreate the bug, tell me.
Tell me everything. I'm really interested on this.
EDIT: changed test map. now it's ok.
So, let me explain to you wtf is going on.
(The test map is attached)
I have two triggers:
-
Init Trigger
-
Events
- Map initialization
- Conditions
-
Actions
- Custom script: if false then
- -------- DISABLE THE FOLLOWING ACTION BEFORE TESTING!!! --------
- Set u = Paladin 0000 <gen>
- Custom script: endif
-
Events
-
Test Trigger
-
Events
- Player - Player 1 (Red) types a chat message containing test as An exact match
- Conditions
-
Actions
- Custom script: call BlizzardSurprisesMe( )
-
Events
JASS:
function BlizzardSurprisesMe takes nothing returns nothing
local region rectRegion = CreateRegion()
call RegionAddRect(rectRegion, gg_rct_Region_000)
if IsUnitInRegion(rectRegion, gg_unit_Hpal_0000) then
call BJDebugMsg("Msg 1")
else
call BJDebugMsg("Msg 2")
endif
if RectContainsUnit( gg_rct_Region_000, gg_unit_Hpal_0000 ) then
call BJDebugMsg("Msg 3")
else
call BJDebugMsg("Msg 4")
endif
call BJDebugMsg(" Surprised? Receiving only 2 and 3 no matter what? Oh!")
endfunction
Well, the fact is: This way everything works perfectly. The messages are displayed properly.
BUT, try disabling the "Set u = Paladin 0000 <gen>" action. Yes, disabling. It could be deleting as well, but you can just disable it to see what happens. And yes, when it's enabled, you still keep the "if false" thing.
Disable it and test the map again.
Wherever the unit is, the displayed messages will be 2 and 3!!! WTF!!
Putting something inside an "if false" statement, getting different results? WTF guys?
Could anyone think in something about this?
Since today, I will always set my preplaced units to dummy variables inside an "if false" statement. Or, better, I will never use generated variables anymore.
If you couldn't recreate the bug, tell me.
Tell me everything. I'm really interested on this.
EDIT: changed test map. now it's ok.
Attachments
Last edited: