Random Chitchat 2012-2016
Yeah... but it's also funny... the last thingTongue
Thanks given by:
Yeah, but it's trueTongue

Anyway, anybody want to join me on IRC? #mcserver on freenode.
Thanks given by:
which server?
Thanks given by:
Freenode.
Thanks given by:
can't join. You have to invite me or something...
Thanks given by:
Oh, derp. Will fix.

Should be fixed now.
Thanks given by:
I have lost my place. I am no longer the author of 50 % of all commits.
https://www.ohloh.net/p/mc-server/contributors/summary
Thanks given by:
We're the black sheep of the euro-elections
[Image: tumblr_n65iu6XV361s6c1p2o1_1280.jpg]
Thanks given by:
Wow, less than 20%! (we only got ~35% so not exactly great in the UK eitherTongue)
Thanks given by:
I came up with a way to check if a player is looking at an enderman, but the numbers I get are way too high. Does anyone know why?:
class cPlayerLookCheck :
	public cPlayerListCallback
{
public:
	cPlayerLookCheck(const Vector3d & a_EndermanPos) :
		m_EndermanPos(a_EndermanPos),
		m_Player(NULL)

	{
	}

	virtual bool Item(cPlayer * a_Player) override
	{
		//Vector3d & Direction = a_Player->GetPosition() - m_EndermanPos;
		Vector3d & Direction = m_EndermanPos - a_Player->GetPosition();
		
		// Don't check players who are more then 64 blocks away.
		if (Direction.Length() > 64)
		{
			return false;
		}
		
		// Don't check if the player has a pumpkin on his head.
		if (a_Player->GetEquippedHelmet().m_ItemType == E_BLOCK_PUMPKIN)
		{
			return false;
		}

		Direction.Normalize();
		
		Vector3d & LookVector = a_Player->GetLookVector();
		LookVector.Normalize();
		
		LOGWARN("%d, %d, %d", Direction.x, Direction.y, Direction.z);
		LOGWARN("%d, %d, %d", LookVector.x, LookVector.y, LookVector.z);
		LOGWARN("%d", (Direction - LookVector).SqrLength());
		if ((Direction - LookVector).SqrLength() > 0.5)
		{
			return false;
		}

		// More checks come here.
		return true;
	}

protected:
	cPlayer * m_Player;
	const Vector3d & m_EndermanPos;
} ;

[Image: 93c917469c.png]


Oh wait. It was the LOG function giving wrong numbers.
Thanks given by:




Users browsing this thread: 15 Guest(s)