About Store Forum Documentation Contact

Post Reply 
exception thrown over Chr Obj?
Author Message
jagatai Offline

Post: #1
exception thrown over Chr Obj?
Folks just a quick question:
I have the following NPC Human spawning in my world, it looks fine and moves around fine.
Game.ObjParams obje;
      flt y = Game.World.hmHeight(pos.xz(), true)+1.0f;
      obje.matrix=pos+Vec(0, y, 0);
      obje.base(UID(56234969, 1323290354, 3850143880, 4103657799));
      obje.scale(true, scale);
      obje.type(true, Game.ObjType.elmID(Game.ObjType("OBJ_CHR")));

HOWEVER, every now and then when i click on him with mouse:
if(Ms.bp(0) && Players.elms())
         if(!Gui.ms() || Gui.ms() == Gui.desktop())
                 if(Chr *chr=CAST(Chr, &Cur.obj()))

Client crashes with "Unhandled exception" according to debug its being throw by malloc.c line 89
res = _heap_alloc(size);

which seems to be caused by the above IF after the cursor returns the objects ptr?
if(Chr *chr=CAST(Chr, &Cur.obj()))

I'm still new and learning Esenthel, however it seems the memory address changed for which the object was kept at?

Any help or guidance is appreciated.
(This post was last modified: 05-17-2013 09:40 PM by jagatai.)
05-17-2013 09:39 PM
Find all posts by this user Quote this message in a reply
Esenthel Online

Post: #2
RE: exception thrown over Chr Obj?

Reference objects should be safe, most likely you have a bug somewhere.
Judging from your codes they look fine at first glance, so the problem may be elsewhere.
Would be helpful if you could attach your whole project (not just codes, and as long as it's not a paid package from Esenthel Store) so people could test them.
05-18-2013 12:22 PM
Find all posts by this user Quote this message in a reply
Post Reply