diff options
| author | Alexander Gavrilov | 2012-04-01 11:43:09 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-01 11:43:09 +0400 |
| commit | 73cf822a13df614cf009124bd55dcc7f1790d40e (patch) | |
| tree | 68d071e126bb68bf687c771fdba7c109a2522b2f /plugins/Dfusion | |
| parent | 2b4044f3f2996d6d13fffaefca9603f8a1348c55 (diff) | |
| parent | 5a90e71c879c8cc6cb3066e89c4d149e0d0c54dc (diff) | |
| download | dfhack-73cf822a13df614cf009124bd55dcc7f1790d40e.tar.gz dfhack-73cf822a13df614cf009124bd55dcc7f1790d40e.tar.bz2 dfhack-73cf822a13df614cf009124bd55dcc7f1790d40e.tar.xz | |
Merge remote-tracking branch 'warmist/master'
Diffstat (limited to 'plugins/Dfusion')
| -rw-r--r-- | plugins/Dfusion/luafiles/friendship/init.lua | 6 | ||||
| -rw-r--r-- | plugins/Dfusion/luafiles/friendship/patch.lua | 5 | ||||
| -rw-r--r-- | plugins/Dfusion/luafiles/init.lua | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/plugins/Dfusion/luafiles/friendship/init.lua b/plugins/Dfusion/luafiles/friendship/init.lua index 12981d16..0fc3219e 100644 --- a/plugins/Dfusion/luafiles/friendship/init.lua +++ b/plugins/Dfusion/luafiles/friendship/init.lua @@ -14,9 +14,9 @@ function analyzeF(off) return pos end end -function minEx(...) - local imin=arg[1] - for _,v in ipairs(arg) do +function minEx(list) + local imin=list[1] + for _,v in ipairs(list) do if imin> v and v~=0 then imin=v end diff --git a/plugins/Dfusion/luafiles/friendship/patch.lua b/plugins/Dfusion/luafiles/friendship/patch.lua index 413b98aa..247766db 100644 --- a/plugins/Dfusion/luafiles/friendship/patch.lua +++ b/plugins/Dfusion/luafiles/friendship/patch.lua @@ -11,8 +11,7 @@ function friendship_in.patch() pos3=offsets.find(pos+7,0xa1,DWORD_,crace) -- mov eax,[ptr] pos4=offsets.find(pos+7,0x66,0x8b,ANYBYTE,DWORD_,crace) -- mov ANYREG,[ptr] --pos5=offsets.find(pos+7,0x66,0x8b,0x15,DWORD_,crace) -- mov dx,[ptr] - - pos=minEx(pos1,pos2,pos3,pos4) + pos=minEx{pos1,pos2,pos3,pos4} if pos ~=0 then hits[i]=pos i=i+1 @@ -28,7 +27,7 @@ function friendship_in.patch() --TODO read offset from memory.xml pos1=offsets.find(myp,0x39,ANYBYTE,0x8c,00,00,00) -- compare [reg+08c] (creature race) with any reg pos2=offsets.find(myp,0x3b,ANYBYTE,0x8c,00,00,00) -- compare any reg with [reg+08c] (creature race) - pos=minEx(pos1,pos2) + pos=minEx{pos1,pos2} if pos ~=0 then if(pos-p>250) then diff --git a/plugins/Dfusion/luafiles/init.lua b/plugins/Dfusion/luafiles/init.lua index 9ec8baf2..42b8dd68 100644 --- a/plugins/Dfusion/luafiles/init.lua +++ b/plugins/Dfusion/luafiles/init.lua @@ -14,6 +14,10 @@ function dofile_silent(filename) --safer dofile, with traceback, no file not fou f,perr=loadfile(filename) if f~=nil then return xpcall(f,err) + else + if(string.sub(perr,1,11)~="cannot open") then --ugly hack + print(perr) + end end end function loadall(t1) --loads all non interactive plugin parts, so that later they could be used |
