Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Crash in Lite-c? WTF? [Re: Razoron] #318628
04/08/10 19:27
04/08/10 19:27
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Unexplained crashes are often the result after trying to read memory that doesn't exist. For example you give a pointer that was referencing to an object like an entity, but you deleted that entity. The pointer now points to an address that does not have the entity anymore (and likely something totally different). If you use it, big chance it crashes, or it gives funny behaviour but that is a small chance. Either way is not good. Pointer management is very difficult and errors can be very hard to find.

Try if all the pointers you give to the involved functions contain proper objects.

Code:
enet_ent_create(_str("images/effects/nothing.pcx"),my.x,_str("MgTarget"));


Does the first argument hold the proper path to the image?
Is my not null?
Are you sure you need _str() to create the string? AFAIK the strings will be deleted when the function end, and if enet_ent_create is still using them in the process, it will crash. Use str_create() instead.

I suggest put the _str() functions outside the arguments into separate string variables and consider using str_create().


Click and join the 3dgs irc community!
Room: #3dgs
Re: Crash in Lite-c? WTF? [Re: Joozey] #318733
04/09/10 13:29
04/09/10 13:29
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
All enet_function are working fine, I'm not using them for the first time. Everything is right.
Code:
enet_ent_create(_str("images/effects/nothing.pcx"),my.x,_str("MgTarget"));


didn't crash,
Code:
enet_ent_remove(enet_ent_globpointer(ent_MyPlane));


crashed.
I soluted the problem with a simple wait(1); before it. Don't ask me why this works, maybe because I read some skills direct before i deleted the entity.
Code:
if(ent_MyPlane.team==TEAM1 && (MY_CONNECTION==1 || MY_CONNECTION==3))
		{
			OnlineDeathOne(-2,"");
		}
		if(ent_MyPlane.team==TEAM2 && (MY_CONNECTION==1 || MY_CONNECTION==3))
		{
			OnlineDeathTwo(-2,"");
		}
		if(ent_MyPlane.team==TEAM1 && MY_CONNECTION!=3 && MY_CONNECTION!=1)
		{
			enet_send_event(EVENT_DEATH_ONE,str_create(""),SERVER);
		}
		if(ent_MyPlane.team==TEAM2 && MY_CONNECTION!=3 && MY_CONNECTION!=1)
		{
			enet_send_event(EVENT_DEATH_TWO,str_create(""),SERVER);
		}


Ok, it works now, thanks to all who tried to help me.

Last edited by Razoron; 04/09/10 13:30.
Re: Crash in Lite-c? WTF? [Re: Razoron] #318831
04/10/10 09:15
04/10/10 09:15
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Btw. it looks like you are using an old anet.h file, because this was only in a BETA version of ANet (the functions that are not found). Maybe also your ANet.dll is outdated.
You can get the new version for free from http://www.anet-plugin.com. Just download the ANet demo and use those files (in combination with your ANet key). Please read the updates section of the manual before using the new anet.dll.

EDIT: The new manual can also be downloaded on the homepage.

Last edited by Dark_samurai; 04/10/10 09:16.

ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Crash in Lite-c? WTF? [Re: Dark_samurai] #318901
04/10/10 17:30
04/10/10 17:30
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
I'm usimg the latest official files now. Still there are missing functions:

enet_disconnect_client@1: function not found
voip_add_receiver: function not found
voip_recv: function not found
voip_reset_receivers: function not found
voip_send: function not found
voip_set_ent: function not found
voip_set_quality: function not found
voip_set_server: function not found
voip_set_volume@1: function not found

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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