tssmods
http://tssmods.freeforums.org/

BagTrack
http://tssmods.freeforums.org/bagtrack-t39.html
Page 1 of 1

Author:  ganzzz [ Wed May 20, 2009 8:49 am ]
Post subject:  BagTrack

Greetings!, here has found some errors:
1. At a game quit on escape the heap of memory the lost,
Engine.Free not working...

change:
function TG2Mdl_Tss.Quit(const P: G2Array; const Script: TG2Execute): TG2Variant;
begin
Result:=nil;
if G2ParamMaxError(0, P, Script) then Exit;
Engine.Running := False;// PostQuitMessage(0);
end;

and in main loop:
function CTssApp.MsgProc(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
begin
if Engine.Running = False then SendMessage(m_hWnd,WM_CLOSE,0,0);
...
end;

Author:  PimpDaddy [ Wed May 20, 2009 8:05 pm ]
Post subject: 

Thanks for that, but what is Engine.Running? Is this a custom variable you have added, as I cannot find it in my version of the source.

EDIT: Never mind, I got it working :)

Author:  ganzzz [ Wed May 20, 2009 10:00 pm ]
Post subject: 

This variable should be added, I have forgotten about it to write)

Author:  PimpDaddy [ Thu May 21, 2009 1:02 am ]
Post subject: 

Yep, I added the variable and got it working, thanks for that :)

So does doing this prevent a memory leak or something?

Author:  ganzzz [ Thu May 21, 2009 5:03 am ]
Post subject: 

Then i write small stuff to save console command bufer to file:

destructor TTssConsole.Destroy;
var
FileName: string;
begin
...
FileName := ChangeFileExt(ParamStr(0),'.lst');
FOldCommands.SaveToFile(FileName);
FOldCommands.Free;
inherited;
end;

then file game.lst not exist!
interesting that at Alt+F4 all work corect...

Author:  PimpDaddy [ Fri May 22, 2009 2:43 am ]
Post subject: 

I would assume it's because you are trying to change the currently running program to a .lst file.

Author:  ganzzz [ Fri May 22, 2009 5:57 am ]
Post subject: 

PimpDaddy wrote:
I would assume it's because you are trying to change the currently running program to a .lst file.


HeHe))), no, a'm save console command bufer to file named like program(with full path), and extension .lst)))

example: ChangeFileExt(ParamStr(0),'.lst') return:
d:\prj\tss\tss_demo\game.lst

same as i use: ChangeFileExt(ParamStr(0),'.log') to get log file name.

pascal I know normally, that not say about Direct3D and English...(((

Author:  PimpDaddy [ Fri May 22, 2009 9:48 am ]
Post subject: 

Oh ok, now I get it :)

That's interesting about the .lst file though, from using your code, it worked for me.

This is what I used:

Code:
destructor TTssConsole.Destroy;
var
  str : string;
begin
FTickCount.Free;
FBuffer.Free;
str := ChangeFileExt(ParamStr(0),'.lst');
FOldCommands.SaveToFile(str);
FOldCommands.Free;
FreeMem(FCommands);
inherited;
end;


It created an empty .lst file in the directory of the exe.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/