|
发表于 2007-11-10 10:28:22
|
显示全部楼层
比如先把循环后面的语句用双反斜杠//注释掉,然后加上那个检查的句子
[codes=jass]function debugmsg takes string s returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,10,s)
endfunction
function ItemUp takes integer i,integer n,unit u returns nothing
local integer a = i
local integer b= n
local integer c=0
local player p =GetOwningPlayer(u)
loop
exitwhen a > b
if ( udg_ItemType[a] == GetItemTypeId(UnitItemInSlotBJ(u, 1)) ) then
set c = a
else
endif
set a= a + 1
endloop
call debugmsg("循环结束 a="+I2S(a))
call debugmsg("循环结束 b="+I2S(b))
call debugmsg("循环结束 c="+I2S(c))
// if ( c==0 ) then
// call DisplayTimedTextToPlayer( p, 0, 0, 3.00, "|c009D2B56请在物品栏第一格放置可升级的物品退还打造费!|r" )
// call AdjustPlayerStateBJ( 1000, p, PLAYER_STATE_RESOURCE_GOLD )
// else
// call RemoveItem( UnitItemInSlotBJ(u, 1) )
// call UnitAddItemByIdSwapped( udg_ItemType[(c + 1 )], u )
// endif
// set c = 0
endfunction
[/codes] |
|