找回密码
 点一下
查看: 1205|回复: 10

这样的点要不要清除

[复制链接]
发表于 2008-7-16 20:41:47 | 显示全部楼层 |阅读模式
函数
function Jass takes location p returns nothing
        xxxx
endloop
函数里是用坐标写的


触发动作是
call Jass(GetUnitLoc(GetTriggerUnit())


有泄露嘛?
发表于 2008-7-16 20:55:10 | 显示全部楼层
会有泄露,点仍然需要清除
回复

使用道具 举报

 楼主| 发表于 2008-7-16 21:07:49 | 显示全部楼层
咋个清除法?
回复

使用道具 举报

发表于 2008-7-16 21:09:01 | 显示全部楼层
local location loc = GetUnitLoc(GetTriggerUnit()
call Jass(loc)
call RemoveLocation(loc)
回复

使用道具 举报

发表于 2008-7-16 21:10:09 | 显示全部楼层
call RemoveLocation(GetUnitLoc(GetTriggerUnit()))

可惜我不懂什么意思……
回复

使用道具 举报

发表于 2008-7-16 21:13:02 | 显示全部楼层
这样不行的额,这样会新建一个点再清除的,原来的点还留着………………
回复

使用道具 举报

发表于 2008-7-16 21:41:26 | 显示全部楼层
3 楼 正 解 . . . . .



附 歪 解

function Jass takes location p ,boolean wantRemove returns nothing
        xxxx
        if wantRemove then
        call RemoveLocation( p )
        endif
endloop

回复

使用道具 举报

 楼主| 发表于 2008-7-16 22:09:16 | 显示全部楼层
那如果改成

函数
function Jass takes unit tempunit returns nothing
       xxxx
endloop

函数里本来的GetLocationX改成GetUnitX


触发动作
call Jass(GetTriggerUnit())
呢?

貌似就没泄露了=。=
回复

使用道具 举报

发表于 2008-7-16 22:20:00 | 显示全部楼层
恩,GetUnitX,GetUnitY不会泄露的
回复

使用道具 举报

 楼主| 发表于 2008-7-16 22:31:53 | 显示全部楼层


送你一张好人卡
回复

使用道具 举报

发表于 2008-7-16 22:34:57 | 显示全部楼层
唉唉,卡就不必了,解决的话就改分类吧
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-20 22:22 , Processed in 0.036347 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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