|
E1513 Crash maybe bug? verry curious
#293953
10/15/09 05:06
10/15/09 05:06
|
Joined: Oct 2009
Posts: 14
uniquy
OP
Newbie
|
OP
Newbie
Joined: Oct 2009
Posts: 14
|
Hi, sitting on this for 3 hours... and i realy think, that it only can be a BUG. In this minimalistic code, you can see 2 "BAD" lines. If one of it is removed, the code work. Otherwise, together, i get:
E1513 Crash in ModelAdded
But whats realy crazy: If i set the ModelAdded function to just 1 parameter (ENTITY* ent_added), it works fine too.
#include <acknex.h>
#include <default.c>
ENTITY* ent;
void ModelAdded(ENTITY* ent_added, STRING* var_val){
FONT* font1 = "Arial#18b";
VECTOR* tmp;
VECTOR* tmp2;
vec_set(tmp.y, tmp2.y); // BAD LINE 1
TEXT* txt = txt_create(1,1); // BAD LINE 2
}
void main()
{
level_load("level.wmb");
wait(3);
ent = ent_create("cube.mdl",vector(0,0,0),NULL);
ModelAdded(ent,"test");
}
Last edited by uniquy; 10/15/09 05:14.
|
|
|
Re: E1513 Crash maybe bug? verry curious
[Re: uniquy]
#293954
10/15/09 05:20
10/15/09 05:20
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
actual bad lines are this three;
FONT* font1 = "Arial#18b"; VECTOR* tmp; VECTOR* tmp2;
on runtime you have to create fonts with font_create, FONT* font1 = font_create("Arial#18b");
and then, tmp and tmp2 are just VECTOR pointers and not VECTORs and they are currently pointing to nothing, if you try to use them youll get a crash. so change this lines: VECTOR* tmp; VECTOR* tmp2; with: VECTOR tmp; VECTOR tmp2;
---
and before sitting in front of it 3 hours, and thinking it can only be a bug, check the manual.
3333333333
|
|
|
Re: E1513 Crash maybe bug? verry curious
[Re: Quad]
#293956
10/15/09 05:34
10/15/09 05:34
|
Joined: Oct 2009
Posts: 14
uniquy
OP
Newbie
|
OP
Newbie
Joined: Oct 2009
Posts: 14
|
oh sh.. im sorry! checked the manual many times, and searched here, but... ouph, could be  im a noob o.O But realy thanks!
|
|
|
Re: E1513 Crash maybe bug? verry curious
[Re: archie]
#307515
01/29/10 19:33
01/29/10 19:33
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! Also look for Programming Trouble: FAQ in manual 
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|