| 07-13-2007, 09:32 PM | #1 |
How are do you use boolexprs with structs? Do you have to pass the struct over to the boolexpr function or is there another way? |
| 07-13-2007, 10:49 PM | #2 |
function or code type cannot be stored inside array. structs is just global arrays. again and again peoples think that structs is some thing different. |
| 07-13-2007, 10:51 PM | #3 | |
Quote:
Although I think that would be pretty much useless. |
| 07-14-2007, 08:22 PM | #4 |
I was thinking if there was a way to pass it in a situation like this: JASS:function bxpr takes nothing returns boolean IsUnitEnemy( GetFilterUnit(), GetOwningPlayer(**Unit**) ) == true endfunction function a takes nothing returns nothing //Say I was using struct on this func local group g = CreateGroup() call GroupEnumUnitsInRange( g, 0,0, 200, Condition( function bxpr ) ) ... endfunction |
| 07-14-2007, 08:39 PM | #5 |
Use a temp global. |
| 07-14-2007, 09:21 PM | #6 |
temp = temporarily? whats a temp global? |
| 07-14-2007, 09:27 PM | #7 |
A global that you use only for an instant to transfer stuff between threads. |
| 07-14-2007, 10:50 PM | #8 |
like that JASS:[b]globals unit tmp_unt=null endglobals[/b] function bxpr takes nothing returns boolean IsUnitEnemy( GetFilterUnit(), GetOwningPlayer([b]tmp_unt[/b]) ) == true endfunction function a takes nothing returns nothing //Say I was using struct on this func local group g = CreateGroup() [b]set tmp_unt=Your_Unit[/b] call GroupEnumUnitsInRange( g, 0,0, 200, Condition( function bxpr ) ) ... endfunction |
