Skip to content

Instantly share code, notes, and snippets.

@AndrewWeston9
Last active October 6, 2017 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewWeston9/99665f24d8294e1f6f423515821c720e to your computer and use it in GitHub Desktop.
Save AndrewWeston9/99665f24d8294e1f6f423515821c720e to your computer and use it in GitHub Desktop.
WorldManager.cs Snippet: Function to remove flag from the region block.
// Checks to see if the flag can be removed by the player requesting the removal or not.
public bool removeFlag(int x, int y, int z, int connid)
{
if ((x >= 0) && (x < blockSize) &&
(y >= 0) && (y < blockSize) &&
(z >= 0) && (z < MaxBlockHeight))
{
if (blockStructure [getIndex (x, y, z)].playerConnectionId == connid)
{
return true;
}
else
{
return false;
}
//Debug.LogError ("updating block health");
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment