to be honest i have no idea how to do that window thingy...
think ill just do it later, when i get a little more experience with the engine!
and i got the error because i forgot to put the argument thingy "()" after my function call, and forgot to refer to it as a pointer...
but still it will only pick up the items in order :S
have any idea what might be wrong?
heres my code:
Code:
Game::Item* checkItems()
{
Game::Item *temp =NULL;
for(int i=0;i<ELMS(Items);i++)
{
if(Dist(Items[i].pos(), Players[0].pos())< 2.0)
{
temp =&Items[i];
}
}
return temp;
}
/******************************************************************************/
void Player::updateItems()
{
if(Kb.bp(KB_LCTRL)){
if(Items.elms()){
if(Dist(Items[0].pos(), Players[0].pos())<=1) itemPickUp(*checkItems());
}
}
}
it runs without errors, but i can still only pick up the items in order as if i used Items[0] as argument for the itemPickUp...
can you tell me whats wrong?