Example #1
0
void Player::Respawn()
{
	if (IsDead() == false)
	{
		return;
	}

	m_position = m_respawnPosition;
	
	// Make sure we create a chunk in the respawn position
	UpdateGridPosition();
	m_pChunkManager->CreateNewChunk(GetGridX(), GetGridY(), GetGridZ());

	m_health = m_maxHealth;

	VoxGame::GetInstance()->GetHUD()->UpdatePlayerData();

	// Also go through all the equipped items and equip them
	for (int i = 0; i < EquipSlot_NumSlots; i++)
	{
		InventoryItem* pItem = m_pInventoryManager->GetInventoryItemForEquipSlot((EquipSlot)i);
		if (pItem != NULL)
		{
			EquipItem(pItem, true);
		}
	}

	m_dead = false;
}
Example #2
0
std::vector<int> SceneImporter::GetGridDims(){
	std::vector<int> m_grid_dims(3);
	m_grid_dims[0] = GetGridX();
	m_grid_dims[1] = GetGridY();
	m_grid_dims[2] = GetGridZ();

	return m_grid_dims;
}