找回密码
 点一下
查看: 1641|回复: 4

这段函数的排泄

[复制链接]
发表于 2010-7-4 13:41:15 | 显示全部楼层 |阅读模式
  1. function Trig03 takes nothing returns boolean
  2.     local timer tm   =GetExpiredTimer()
  3.     local integer parentKey = GetHandleId( tm )
  4.     local unit  a  = LoadUnitHandle(gc2(), parentKey, 0)
  5.    
  6.     set tm =null
  7.     return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(a) == true )
  8.    
  9. endfunction
复制代码

我想排泄。。unit  a  可是前面又不能直接设置为null,后面也不能。。左右为难。。。

如果改成这样。。 不知道达到了上面的效果没
  1. function Trig03 takes nothing returns boolean
  2.     local timer tm   =GetExpiredTimer()
  3.     local integer parentKey = GetHandleId( tm )
  4.     local unit  a  = LoadUnitHandle(gc2(), parentKey, 0)
  5.    
  6.    
  7.    if( not(IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(a) == true ))   then
  8.   return false
  9.    endif
  10. return true
  11.    
  12. set tm =null
  13. set a =null
  14.   endfunction
复制代码
发表于 2010-7-4 13:58:47 | 显示全部楼层
[codes=jass]function Trig03 takes nothing returns boolean
    local timer tm   =GetExpiredTimer()
    local integer parentKey = GetHandleId( tm )
    local unit  a  = LoadUnitHandle(gc2(), parentKey, 0)
    local boolean result = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(a) )
    set tm =null
    set a = null
    return result
endfunction[/codes]
回复

使用道具 举报

 楼主| 发表于 2010-7-4 14:03:19 | 显示全部楼层
太感谢了。。
回复

使用道具 举报

发表于 2010-8-16 17:04:25 | 显示全部楼层
呵呵 宝宝最近迷上Jass了?
想来接手红宝石不?我最近实在太忙了~
回复

使用道具 举报

 楼主| 发表于 2010-8-17 17:00:23 | 显示全部楼层
。。。怕太累。。

我就有时间的时候喜欢研究。。功能罢了。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-3 17:51 , Processed in 0.116076 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表