Random Chitchat 2012-2016
Slime loading, line 13: you're converting a pointer into a reference, I would expect that not to compile at all; then you're leaking the slime object if it doesn't load successfully. Use the same technique as in skeleton-loading - auto_ptr. I don't see why the skeleton loading should fail, no apparent problems there. Maybe push it to a branch so that I can give it a try with the debugger.
Thanks given by:
Mobs saviing!!Big Grin
Thanks given by:
Code #2:

It runs, I can sometimes even see the skeleton, but it immediately stops responding and after a while the deadlock detector asserts. I'll push to a branch soon, thanks!
Thanks given by:
I was wondering why the code didn't work until I discovered that GetMobType doesn't return the mob type of the mob. I found out that it returns a big number for example "24114938". http://puu.sh/5jZ2U.png
Thanks given by:
Pushed to mobsaving branch, please examine Smile
Thanks given by:
(11-17-2013, 12:26 AM)STR_Warrior Wrote: I was wondering why the code didn't work until I discovered that GetMobType doesn't return the mob type of the mob. I found out that it returns a big number for example "24114938". http://puu.sh/5jZ2U.png
Are you sure a_Entity is a cMonster descendant? Also, is that in debug or release? Release mode is sometimes wrong about variable values in the debugger, because of various optimizations.

(11-17-2013, 01:54 AM)tigerw Wrote: Pushed to mobsaving branch, please examine Smile
Later today, we have the in-laws coming for a visit so we're pretty busy right now Smile
Thanks given by:
(11-17-2013, 09:59 PM)xoft Wrote: Are you sure a_Entity is a cMonster descendant? Also, is that in debug or release? Release mode is sometimes wrong about variable values in the debugger, because of various optimizations.

I use
if (!a_Entity->IsMob())
{
	return false;
}
if (((cMonster &)a_Entity).GetMobType() == mtWolf)
{
I tried it in debug and in release mode.
Thanks given by:
So is a_Entity a pointer or a reference? On line 1 you're using it as a pointer, on line 5 as a reference. If it's a pointer, cast it to cMonster * and it should work.
Thanks given by:
The mobsaving code was a mess, mixing references with pointers. I've fixed it and it seems to work; didn't test much though.
Thanks given by:
I tested it and it's working very well. Why don't merge it?
Thanks given by:




Users browsing this thread: 30 Guest(s)