1
Stealth Client / Re: CheckLOS function broken?
« on: September 11, 2016, 08:55:51 AM »
In standard Pascal script you have to choose the type of emulator your are working with.
Not sure this is exported to external script though...
Modification post edit
I've checked and this seems to be related on the way ScriptSDK is exporting the CheckLOS function. If you look at the stealth_script.pas that is packed with the standard Stelath distro you'll see that the function is exported as following:
and the used like this:
@Chrome969
Maybe you should review the ScriptSDK source on this: last two parameters (LOSCheckType and LOSOptions) are missing![Wink ;)](http://www.scriptuo.com/Smileys/yarex2/wink.gif)
Code: [Select]
TLOSCheckType = (losSphere = 1, losSphereAdv = 2, losPOL = 3, losRunUO = 4);
TLOSCheckOption = (losSphereCheckCorners, losPolUseNoShoot, losPolLOSThroughWindow);
TLOSCheckOptions = set of TLOSCheckOption;
Not sure this is exported to external script though...
Modification post edit
I've checked and this seems to be related on the way ScriptSDK is exporting the CheckLOS function. If you look at the stealth_script.pas that is packed with the standard Stelath distro you'll see that the function is exported as following:
Code: [Select]
function Script_CheckLOS(xf, yf : Word; zf : ShortInt; xt, yt : Word; zt : ShortInt; WorldNum : Byte; LOSCheckType : Byte; LOSOptions : Cardinal) : Boolean; stdcall; external ConstScriptDLL name 'Script_CheckLOS';
and the used like this:
Code: [Select]
function TMover.CheckLOS(xf, yf : Word; zf : ShortInt; xt, yt : Word; zt : ShortInt; WorldNum : Byte; LOSCheckType : TLOSCheckType; LOSCheckOptions : TLOSCheckOptions) : Boolean;
var LOSOptions : Cardinal;
begin
LOSOptions := 0;
if losSphereCheckCorners in LOSCheckOptions then
LOSOptions := $100;
if losPolUseNoShoot in LOSCheckOptions then
LOSOptions := LOSOptions OR $200;
if losPolLOSThroughWindow in LOSCheckOptions then
LOSOptions := LOSOptions OR $400;
Result := Script_CheckLOS(xf, yf, zf, xt, yt, zt, WorldNum,Byte(LOSCheckType),LOSOptions);
end;
@Chrome969
Maybe you should review the ScriptSDK source on this: last two parameters (LOSCheckType and LOSOptions) are missing
![Wink ;)](http://www.scriptuo.com/Smileys/yarex2/wink.gif)