View Single Post
Old 04-14-2010, 01:58 AM   #6
PurgeandFire111
User
 
PurgeandFire111's Avatar
 
Join Date: Dec 2006
Posts: 253

PurgeandFire111 will become famous soon enough (58)PurgeandFire111 will become famous soon enough (58)

Default

This:
Collapse JASS:
//is this needed? =P
function calc takes real a, real b, string x returns real 
//local real r 
if     x == "+" then
    /*set r =*/ return a + b
elseif x == "-" then
    /*set r =*/ return a - b
elseif x == "*" then
    /*set r =*/ return a * b
elseif x == "/" then
    /*set r =*/ return a / b
elseif x == "^" then
    /*set r = Pow(a,b)*/
    return a^b //should be faster
endif 
return 0
endfunction

For function "constants", just use direct returns (as done above) as well.
Collapse JASS:
call DisplayTimedTextToForce(GetPlayersAll(), 6.00, a)
set a = ""

Use bj_FORCE_ALL_PLAYERS directly instead of GetPlayersAll(), and you don't need to set a to "".

Also, I don't understand this code that much:
Collapse JASS:
    if S2R(S) == I2R(R2I(S2R(S))) then
        set S = I2S(R2I(S2R(S)))
    endif

Well, unless you are trying to compare it to the truncated value.

That's all I could really find at the moment.
PurgeandFire111 is offline   Reply With Quote