05-25-2014, 09:38 PM
Yeah... but it's also funny... the last thing
|
Random Chitchat 2012-2016
|
|
05-25-2014, 09:38 PM
Yeah... but it's also funny... the last thing
05-26-2014, 12:53 AM
Yeah, but it's true
![]() Anyway, anybody want to join me on IRC? #mcserver on freenode.
05-26-2014, 01:23 AM
which server?
05-26-2014, 01:27 AM
Freenode.
05-26-2014, 01:28 AM
can't join. You have to invite me or something...
Oh, derp. Will fix.
Should be fixed now.
05-29-2014, 07:09 AM
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
05-29-2014, 07:16 PM
We're the black sheep of the euro-elections
05-29-2014, 07:45 PM
Wow, less than 20%! (we only got ~35% so not exactly great in the UK either
)
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;
} ;
![]() Oh wait. It was the LOG function giving wrong numbers. |
|
« Next Oldest | Next Newest »
|