Exemplo n.º 1
0
//*************************************************************************************
// Entity * FlyingOverObject(EERIE_S2D * pos)
//-------------------------------------------------------------------------------------
// FUNCTION/RESULT:
//   Returns IO under cursor, be it in inventories or in scene
//   Returns NULL if no IO under cursor
//*************************************************************************************
Entity * FlyingOverObject(const Vec2s & pos)
{
	Entity* io = NULL;

	// TODO do this properly!
	if(player.torch && eMouseState == MOUSE_IN_TORCH_ICON) {
		return player.torch;
	}
	
	if((io = GetFromInventory(pos)) != NULL)
		return io;

	if(InInventoryPos(pos))
		return NULL;

	if((io = InterClick(pos)) != NULL)
		return io;

	return NULL;
}
Exemplo n.º 2
0
Entity * FlyingOverObject(const Vec2s & pos) {
	
	// TODO do this properly!
	if(player.torch && eMouseState == MOUSE_IN_TORCH_ICON) {
		return player.torch;
	}
	
	if(Entity * entity = GetFromInventory(pos).first) {
		return entity;
	}
	
	if(InInventoryPos(pos)) {
		return NULL;
	}
	
	if(Entity * entity = InterClick(pos)) {
		return entity;
	}
	
	return NULL;
}