11-15-2013, 06:07 PM
(11-15-2013, 05:46 AM)bearbin Wrote: How strange. There's a forum post on the bitcoin forums where you could complain I think.I tried registering there, but it didn't work - it said my password is too short and when I tried again, it said I'm already registered, but the login didn't work and registering for a different account said I need to wait 45 minutes. Not gonna bother anymore.
Here it is.
(11-15-2013, 04:10 PM)tonibm19 Wrote: Y think you can check mob type directly in cEntity. Use Entity:GetClass(). It returns cPickup and entity tipe but if its a mob it returns cWolf, cCreeper...Not good - that's comparing strings, which is order of magnitude slower than comparing enums, even with the double step.
Probably the best code to check if an entity is a specific mob type currently is (if a_Entity is a cEntity *):
if (a_Entity->IsMob() && (((cMonster *)a_Entity)->GetMonsterType() == cMonster::mtWolf))
or if a_Entity is a const cEntity &, then:
if (a_Entity.IsMob() && (((const cMonster &)a_Entity).GetMonsterType() == cMonster::mtWolf))