Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,733 guests, and 39 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
no crash with -diag, but crash without #272472
06/18/09 09:21
06/18/09 09:21
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi,

when I start my project with -diag everything runs fine.

But without I get a "Crash in goto_node".

Code:
void goto_node(ENTITY* ent, int nodenr) {	
	VECTOR ptemp;
	diag("\ngoto_node:");
	diag(str_for_num(NULL, nodenr));
	var result = path_getnode(ent, nodenr, ptemp, NULL);
	if (result != 0) {		
		diag_var("\nnode.x: %6.3f",ptemp.x);
		diag_var("\nnode.y: %6.3f",ptemp.y);
		diag_var("\nnode.z: %6.3f",ptemp.z);
		rotateToPosition(ent, ptemp);			
		initPos(ent);
		path_MDJK_find(ent, ent.PtDep, nodenr);
		ent.walkMode = 1;
	}
}


Can someone help me what's wrong with this function and why the crash don't occur when using -diag?

Best regards,
Pegamode.

Re: no crash with -diag, but crash without [Re: pegamode] #272504
06/18/09 11:49
06/18/09 11:49
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I "suspect" its the line diag(str_for_num(NULL, nodenr));
I think -diag on is creating a temporary string space for your str_for_num to dump into.
But with -diag off, the string space is not being created, and so the str_for_num crashes.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: no crash with -diag, but crash without [Re: EvilSOB] #272506
06/18/09 12:00
06/18/09 12:00
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hmmm ... maybe you're right with that. I'll check that as soon as I am at home.

Re: no crash with -diag, but crash without [Re: pegamode] #272518
06/18/09 12:25
06/18/09 12:25
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
The diag functions in the above code are called also when -diag is not set - so at a first glance diag(str_for_num(NULL.. should not cause a crash. Of course it could be some side effect.


Moderated by  old_bill, Tobias 

Gamestudio download | 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