Folks just a quick question:
I have the following NPC Human spawning in my world, it looks fine and moves around fine.
Code:
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")));
super.create(obje);
HOWEVER, every now and then when i click on him with mouse:
Code:
if(Ms.bp(0) && Players.elms())
{
if(!Gui.ms() || Gui.ms() == Gui.desktop())
{
if(Cur.valid)
{
if(Cur.obj.valid())
{
if(Chr *chr=CAST(Chr, &Cur.obj()))
{
Chat.New(S+"Hit");
Client crashes with "Unhandled exception" according to debug its being throw by malloc.c line 89
Code:
res = _heap_alloc(size);
which seems to be caused by the above IF after the cursor returns the objects ptr?
Code:
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.
Thanks,
-J