Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Petra, AndrewAMD, Quad, VoroneTZ, 1 invisible), 488 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
engine_gettaskinfo problem #445593
09/16/14 12:55
09/16/14 12:55
Joined: Nov 2012
Posts: 62
Istanbul
T
Talemon Offline OP
Junior Member
Talemon  Offline OP
Junior Member
T

Joined: Nov 2012
Posts: 62
Istanbul
Hello, I need a quick help from you. I'm trying to track down a bug, which crashes the game ONLY on Win8+ machines. I've tracked until a wait(1) statement and I'm trying to use engine_gettaskinfo to list what function will get called next but on this occasion, its output is a bit strange.

One of the function names is either (null) or some garbled data 4-5 characters long. When this happens, the list is printed twice as if the control variable is reset. And if it's not "(null)", it crashes the program.

Is there a length limit on function names for the engine(A8)? What can cause such an issue with an engine function?

I'm using this code to print out the function names:

Code:
char* l_tmp = sys_malloc(sizeof(char) * 100);
ENTITY* l_me = NULL;
var i = 0;
diag("\nRUNNING FUNCTIONS");
while(engine_gettaskinfo(i, &l_tmp, &l_me) != NULL)
{
	diag("\n");
	diag(l_tmp);
	i++;
}
sys_free(l_tmp);


Re: engine_gettaskinfo problem [Re: Talemon] #445598
09/16/14 16:40
09/16/14 16:40
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Diag takes a string parameter so use
Code:
diag(_str(l_tmp));



Also why not just do
Code:
char l_tmp[100];


Much shorter if you dont need the data outside of the stack tongue

Re: engine_gettaskinfo problem [Re: Ch40zzC0d3r] #445603
09/17/14 08:06
09/17/14 08:06
Joined: Nov 2012
Posts: 62
Istanbul
T
Talemon Offline OP
Junior Member
Talemon  Offline OP
Junior Member
T

Joined: Nov 2012
Posts: 62
Istanbul
Thanks, I'll try that.
Because then you have to write something like this:
diag(&(l_tmp[0]));

Re: engine_gettaskinfo problem [Re: Talemon] #445618
09/17/14 14:43
09/17/14 14:43
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
&l_tmp[0] is the same as l_tmp


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1