void Update_BuildingPlacing() { vec2 GridCoord = ScreenToGridCoord(Input.CurMousePos) - new vec2(1, 1); try { CanPlaceItem = CheckBuildingAvailability(GridCoord, MyPlayerNumber, MyTeamNumber, BuildingUserIsPlacing, CanPlace); } catch { CanPlaceItem = false; } if (LeftMousePressed && MyPlayerInfo != null) { if (!MyPlayerInfo.DragonLordAlive && !MapEditorActive) { Message_NoDragonLordConstruction(); } else if (!CanPlaceItem) { Message_CanNotPlaceHere(); } else if (!MapEditorActive && !MyPlayerInfo.CanAffordBuilding(BuildingUserIsPlacing)) { Message_InsufficientGold(); } else { try { Networking.ToServer(new MessagePlaceBuilding(GridCoord, Int(BuildingUserIsPlacing))); if (!MapEditorActive) { EndPlaceMode(); } } catch { } } } }